I would like to make an object\'s structure immutable, preventing its properties from being subsequently replaced. The properties need to be readable, however. Is this possi
As mkoryak said, you can create a closure to hide properties
function Car(make, model, color) { var _make = make, _model = model, _color = color; this.getMake = function() { return _make; } } var mycar = new Car("ford", "mustang", "black"); mycar.getMake(); //returns "ford" mycar._make; //error