ways to creat an object in javascript
//ways to creat an object in javascriptfunction log(s){
console.log(s);
}
1.the easyest way: literals
var person={
name:'windylcx',//here the comma is requried
sex:'male'//no comma
}
原创
2011-10-23 16:26:13 ·
645 阅读 ·
0 评论