构造器 // 构造函数 function People(name,age){ this.name = name this.age = age this.say = function(){ console.log(this.name, this.age) } } var people1 = new People("Tom", 18) people1.say() console.log(people1)