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的静态和私有的概念 #11

Open
lovelmh13 opened this issue Feb 6, 2020 · 0 comments
Open

快速区分class的静态和私有的概念 #11

lovelmh13 opened this issue Feb 6, 2020 · 0 comments

Comments

@lovelmh13
Copy link
Owner

lovelmh13 commented Feb 6, 2020

私有是在类的实例上的概念。只能在当前类里访问到。
静态是只不需要new一个实例,这些属性存在于类本身上面而不是类的实例上

class A{
 static name(){
  return 'lmh'
 }
}
A.name()
@lovelmh13 lovelmh13 changed the title 快速记住class的静态和私有的概念 快速区分class的静态和私有的概念 Feb 6, 2020
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