-
Notifications
You must be signed in to change notification settings - Fork 97
New issue
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
第 22题(2019-08-20)::ES5/ES6 的继承除了写法以外还有什么区别? #24
Labels
Comments
来源:Understanding ECMAScript 6 1.class 声明会提升,但不会初始化赋值。Foo 进入暂时性死区,类似于 let、const 声明变量。
2.class 声明内部会启用严格模式。
3.class 的所有方法(包括静态方法和实例方法)都是不可枚举的。
4.class 的所有方法(包括静态方法和实例方法)都没有原型对象 prototype,所以也没有[[construct]],不能使用 new 来调用。
5.必须使用 new 调用 class。
6.class 内部无法重写类名。
|
函数声明可以被提升;而类声明与 let 声明类似,不能被提升 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
No description provided.
The text was updated successfully, but these errors were encountered: