Thanks for the heads up! I did some more research after you mentioned this and found a great article that talks about achieving "pseudo-encapsulation" through the use of factory functions and closures in JS for example. Really cool stuff
Hmm, well according to his article he was saying it wasn't natively supported, in JS at least
"By far one of the biggest anomalies of JavaScript is it’s inability to natively support encapsulation.
The scoping system was introduced with TypeScript, which is a superset of JavaScript. But unfortunately its not a clear victory yet since, while it does give you a warning, TypeScript code still compiles and runs even when you access the private variables."
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Thanks for the heads up! I did some more research after you mentioned this and found a great article that talks about achieving "pseudo-encapsulation" through the use of factory functions and closures in JS for example. Really cool stuff
Why "pseudo-" though? It can hide variables the same way as class private fields.
Hmm, well according to his article he was saying it wasn't natively supported, in JS at least