//对象的定义 function view(){ for(p in this) document.write(p + ":" + this[p] + "<br>") }
function personal(name,sex,age,birthday,show) { this.name = name this.sex = sex this.age = age this.birthday = new Date(birthday) this.show = view //不要加括号;调用函数的时候再加括号 }
//创建对象实例 var lining = new personal("李宁","男",50,"January 05,2005 12:00:00")