87,987
社区成员
发帖
与我相关
我的任务
分享
function Person(name,age,job){
var o = new Object();
o.name = name;
o.age = age;
o.job = job;
o.sayName = function(){
console.log(this.name);
}
return o;
}
var friend = new Person("Nicholas",29,"Software Engineer");
var friend = new Person("Nicholas",29,"Software Engineer");
这里为啥要用new呢?