Skip to content
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

class 语法 #72

Open
xiaochengzi6 opened this issue Mar 10, 2023 · 0 comments
Open

class 语法 #72

xiaochengzi6 opened this issue Mar 10, 2023 · 0 comments

Comments

@xiaochengzi6
Copy link
Owner

关于 class 语法 参考

class 继承

调用 super 分为两种情况 一种是作为函数调用,代表父类的构造函数,es6 中 子类的构造函数中必须要调用执行一次 super() ,如果子类没有给定 constructor 函数那么将会自动的补充并调用,

第二种情况 super 作为对象时, 在普通方法种 super 指向父类的原型对象,在静态方法种指向父类

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant