javascript学习笔记2

var person=new Object();
person.name='zl';
person.birth=new Date(1985,06,28);
var address=new Object();
address.street='xin hua Street';
address.xho='188';
address.toString=function(){
  return 'This Steet '+this.street+"; the xho is"+this.xho;
}
person.addr=address;
alert(person["addr"]);

你可能感兴趣的:(JavaScript,Date,function,object)