文章分类 -  JS

摘要:----原文链接:http://blog.jobbole.com/18987/Literal NotationLiteral Notation只是在JavaScript中创建对象的一种方法,是的,方法不止这一种。当你打算创建一个对象实例的时候Literal Notation是首选的方法。1 var bill = {}; 上面的代码没太大用处,仅仅只是创建了一个空对象。让我们动态的添加一些属性和方法到这个对象。1 bill.name = "Bill E Goat"; 2 bill.sound = function() { 3 console.log( 'bahhh!. 阅读全文
posted @ 2013-03-07 16:02 D: 阅读(147) 评论(0) 推荐(0)