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:
// Private property
var name = '';
return {
// Public property
classVersion: '1.3',
prevVersions: ['1.2.3', '1.2', '1'],
setName:
Comments
Post a Comment