js中引用类型中array类型
1 var arr = new Array();
arr[0]="a";
arr[1]="b";
2 var arr1=new Array('x','y','z');
3 var arr2=['x','y','z'];
object类型
1 var person=new Object();
person.name='jialiting';
person.age=20;
2.字面量
简单字面量
var person2={}
person2.name="jack";
person2.action=function(){
console.log(this.name);
}
嵌套字面量
var person3={
name:jialiting,
age:20,
action:function(){
console.log(this.name);}
}