function Person(name,age,job){ var o = new Object(); o.sayName = function(){ console.log(name) } return o; } var friend = Person("dudu",25,"worker"); friend.sayName()