es5是通过构造函数和原型链上添加实现类 function Person (name) { this.name = name, this.getName = function () { console.log(this.name) } } Person.prototype.age = 18 Person.prototype.work = function