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

Asus K52DE Specifications

Prince William and Kate Middleton