标签:
创建对象:
1、people = new Object();
people.name = "lin";
people.age = "26“;
2、创建字典对象
people = {name:"lin",age:"30"};
3、通过set方法创建对象
function people(name,age){
this._name = name;
this._age = age;
}
son = people("lin",26);
document.write("name:"+son.name +"age:"+son.age);
标签:
原文地址:http://www.cnblogs.com/yqlog/p/5545949.html