Quantcast
Channel: Nifty Snippets
Viewing all articles
Browse latest Browse all 35

Private properties in ES6 -- and ES3, and ES5

$
0
0
JavaScript famously lacks private properties on objects. The next version will have them (more on that below), but we can have most of the benefits of the upcoming improvement right now (without resorting to the usual hidden variables in the constructor), even on older engines. In this post, I look at what's coming, and what we can do now. "But wait," I hear you say, "Don't we already know how to

Viewing all articles
Browse latest Browse all 35

Trending Articles