标签:
对象字面量语法:
1 var person = { 2 name : "Kangkang", 3 age : 22, 4 sayName : function(){ 5 alert(this.name); 6 } 7 };
最简单方式:
1 var person = new Object(); 2 person.name="Kangkang"; 3 person.age=29; 4 person.sayName=function(){ 5 alert(this.name); 6 };
标签:
原文地址:http://www.cnblogs.com/qiyinmiss/p/4236277.html