Skip to content
Advertisement

Private properties in JavaScript ES6 classes

Is it possible to create private properties in ES6 classes?

Here’s an example. How can I prevent access to instance.property?

JavaScript

Advertisement

Answer

Private class features is now supported by the majority of browsers.

JavaScript
User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement