es6类

88 阅读1分钟

1.类的所有方法都定义在类的prototype属性上面。

image.png

prototype对象的constructor()属性,直接指向“类”的本身,这与 ES5 的行为是一致的。

image.png

image.png