We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
在 ES6 中,Javascript 类主要是 JavaScript 现有的基于原型的继承的语法糖。例如,用函数表达式编写的基于原型的继承,如下所示,
function Bike(model, color) { this.model = model; this.color = color; } Bike.prototype.getDetails = function () { return this.model + " bike has" + this.color + " color"; };
而 ES6 类可以定义为替代
class Bike { constructor(color, model) { this.color = color; this.model = model; } getDetails() { return this.model + " bike has" + this.color + " color"; } }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
在 ES6 中,Javascript 类主要是 JavaScript 现有的基于原型的继承的语法糖。例如,用函数表达式编写的基于原型的继承,如下所示,
而 ES6 类可以定义为替代
The text was updated successfully, but these errors were encountered: