像在函数 ManA 中创建新对象或通过调用构造函数 ManB 那样创建新对象有什么区别吗?
function ManA(name, age)
{
return { name: name, age: age, getAge: function() { return this.age; } };
}
function ManB(name, age)
{
this.name = name;
this.age = age;
this.getAge = function() { return this.age; };
}
var manA = ManA("Tom", 28);
var manB = new ManB("Frank", 25);
谢谢