09 Class 类
Class 的基本语法
简介
class Point {
constructor() {}
toString() {}
}
typeof Point // function
Point === Point.prototype.constructor // true
// 等同于
Point.prorotype = {
constructor() {},
toString() {}
}constructor
Class 表达式
不存在变量提升
私有方法
this 指向
new.target
Class 的继承
简介
Object.getPrototypeOf()
super 关键字
prototype 和 proto
extends 的继承目标
实例的 __proto__
Mixin 模式
最后更新于