DEV Community


Discussion on: Functional VS Object-Oriented Programming

stereobooster profile image

Why "pseudo-" though? It can hide variables the same way as class private fields.

Thread Thread
krtb profile image
Kurt Bauer Author • Edited

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."