---
title: "JavaScript  或（||）运算符的妙用"
author: "何不笑"
date: "2013-03-21T15:42:23Z"
tags: []
categories: ["编程语言"]
slug: "javascript"
draft: false
lastmod: "2013-03-21T15:42:23Z"
id: 1833475
url: "https://wait7758521.iteye.com/blog/1833475"
---

```
var Book = function(author, title){
    this.author = author || 'no author';
    this.title = title || 'no title';
}
```

 

![](http://dl.iteye.com/upload/attachment/0081/9862/027edd1f-5c9e-3345-b3cb-40ed07ce640c.png)