- class Point {
- constructor(x, y) {
- this.x = x;
- this.y = y;
- }
- }
- class ColorPoint extends Point {
- constructor(x, y, color) {
- this.color = color;// ReferenceError
- super(x, y);
- this.color = color;// 正确
- }
- }
来源: http://www.bubuko.com/infodetail-1978668.html