Immutable Object
Use in Node.js:
npm install immutable-object
Or, in a web app. You'll need ES5-shim for this to work in older web browsers.
Examples
var immutable = ; var first = ;var second = first;
You can use immutable.createClass
to define an immutable object constructor that adds methods to the prototype.
var Task = immutable; var task = "Buy ice cream";console; // Any change results in a new object.// So be sure to assign the result to use it.task = task;console; task = task;console;