Closed Aqours closed 6 years ago
I don't know what you're getting at here.
@Aqours If you can use the word private
for accessing the private state of an instance of A
outside of the lexical scope delimited by class A { /* ... */ }
, ... it means that it is no longer private state.
@claudepache We can modify the prototype
of a class dynamically. I think private variable can be accessed by method in prototype
, but cannot be accessed directly by property.
As @claudepache explained above, syntax based on private
and .
is not feasible for JavaScript.
e.g: code