es5类的创建与继承父类:12345678910function Parent(name) { // 实例的属性 this.name = name}// 定义静态属性 =》不在实例Parent.a = 1;Parent.fn = function () { console.log(this.abc, Parent.a)}原先方法:12345678910111213141516171819202122// 原型方法Parent.prototype.getName = function () { console.log(this.name)}// 子类:继承 function Child(name) { // 继承实例的属性 Parent.call(this, name)}// Child.prototype = new Parent();Child.prototype = Object.create(Parent.prototype, { constructor: { value: Child }})// 测试let Chi = new Child('普京');console.log(Chi)