Is it possible to create private properties in ES6 classes?
Here's an example.
How can I prevent access to instance.property
?
class Something {
constructor(){
this.property = "test";
}
}
var instance = new Something();
console.log(instance.property); //=> "test"