JavaScript 或(||)运算符的妙用

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

 



 

你可能感兴趣的:(JavaScript)