Object-Oriented JavaScript, how to achieve public properties/fields

Recently I posted my findings about private fields in JavaScript. So this is a continuation of the post and it talks about public fields in your JavaScript code. So here is a quick example of public properties in your code: function User() {
// Private property
var name = '';

return {
// Public property
classVersion: '1.3',
prevVersions: ['1.2.3', '1.2', '1'],

setName:

Comments

Popular posts from this blog

Genuine Windows 7 Ultimate: The GENUINE Windows 7 activator for x32 and x6480

Types and forms of imitation gemstone and manufactured

7 Tips before you buy detectors for gold and treasures and minerals