002-ES6Class和普通构造函数的区别

ES5以前的构造函数html function MathHandle(x, y) { this.x = x this.y = y } MathHandle.prototype.add = function () { return this.x + this.y } var m = new MathHandle(1, 2) typeof MathHandle // 'function' Ma
相关文章
相关标签/搜索