I'm just wondering if public fields (i.e. those not scoped inside the constructor's closure) are acceptable in JavaScript. While the usual mantra is "don't use public fields, use accessors or properties", I noticed that properties are not yet supported widely across all browsers (IE).
Other languages similar in vein to JavaScript's "everything is public" like Python don't seem to care too much about information hiding and public fields, even those not decorated with properties. So, is it okay to do this in JavaScript?
Example
"Private":
var Class = function()
{
var field = null;
this.getField = function() { return field; };
this.setField = function(value) { field = value; };
};
Public:
var Class = function()
{
this.field = null;
};