Immutable.js – Immutable Data Collections
> The difference for the immutable collections is that methods which would mutate the collection, like 'push', 'set', 'unshift' or 'splice' instead return a new immutable collection.<p>I think this is an unfortunate design decision which should be reconsidered.  Functional operations should have different names than side-effecting operations.  In general, I think that while side-effecting operations are commonly verbs, functional operations should be nouns or prepositions.<p>Particularly in a language without static types, you want to be able to look at an unfamiliar piece of code and see pretty quickly what types it is using.  The semantics of mutable and functional collections are similar enough that using the same names is going to be very confusing, particularly in code that uses both kinds of collection -- and such code will definitely exist.<p>It's important that the names convey the semantics of the operation.  Java's 'BigInteger' is a good example of this being done wrong -- the addition operation is called 'add', for example, and I have read that some newbies call it without assigning the return value to something, expecting it to be a side-effecting operation.  I think that if it were called 'plus', such an error would be much less likely.  We're used to thinking of "a + b" as an expression that returns a value, rather than an object with state.<p>I understand that introducing new names has a cost: people have to learn them.  But keeping the old names is going to drive users nuts.  If you won't change the names altogether, at least append an "F" to them or <i>something</i>.<p>EDITED to add: if you want some ideas, check out FSet: <a href="http://www.ergy.com/FSet.html" rel="nofollow">http://www.ergy.com/FSet.html</a>