Object-Oriented JavaScript, how to achieve private properties/fields
The very basic of Object-Oriented Programming (OOP) is private fields and public methods (not considering features like polymorphism, inheritance, etc). So how to achieve this very basic of OOP in JavaScript. It turns out to be easy. Here is how to have private fields in your custom JavaScript functions/classes and using methods of your function/class to amend it. function User() {
var name =
var name =
Comments
Post a Comment