//对象
var lennon=Object();
lennon.name="John";
lennon.year=1940;
lennon.living=false;
console.log(lennon);
// Object { name="John", year=1940, living=false}
var lennon={name:"John",year:1940,living:false};
console.log(lennon.name);//John
console.log(lennon[0]);
//undefined 因为lennon[0]这个是数组找到第一个元素的方法
var beatles=Array();//创建新的数组,并用刚才创建的lennon对象来填充他的第一个元素
beatles[0]=lennon;
console.log(beatles[0][0]);//undefined
console.log(beatles[0].name);//John
var beatles={};//生命对象
beatles.vocalist=lennon;
console.log(beatles.vocalist.name);//John