//原型模式 function Person(name, age, job) { this.name = name; this.age = age; this.job = job; // this.sayName = function () { // alert(this.name); // }; } Person.prototype.sayName = function () { alert(this.name); }; //调用方法 var p=new Person("姓名","年龄","工作"); //javascript/6975