Answer the question
In order to leave comments, you need to log in
Are there private, public, protected, static in JS?
I tried to find the syntax for declaring a scope for methods and properties in javascript, but it seemed to me that there is no such thing, or if there is, it is syntactically very different from the usual version. If the latter, what does it look like? I couldn't find a clear enough answer on google.
Answer the question
In order to leave comments, you need to log in
There are no private ones yet (but with the help of transpilers, as it were):
class Foo {
#private = 42;
}
class Foo {
static property = 42;
static method() {...}
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question