SOURCE

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()
console 命令行工具 X clear

                    
>
console