News for hackers. Stuff that matters.
Re:Immutable JavaScript data structures, backwards-compatibl... by pimlottc on Tuesday November 04, 2014 @01:54AM (#8555408)
They both mimic the standard Array/Map/Set methods but differ in how they handle mutating methods like push and set. In Facebook's version, these functions return a new immutable instance with the values changed appropriately, while this one throws an error. It also provides a few new methods to combine/transform existing immutables.

I like the look of this one better. IMHO Facebook's approach will lead to confusion and subtle errors when their immutables are mixed up with normal objects and arrays. Personally I think this is think that's an unwise decision that will lead to confusion and subtle errors.

There are no comments on this comment yet.