Tag Archives: Data Collections

Immutable Data Collections


Immutable Data Collections

Converting to v3 from v2? Check out the upgrade guide.

Immutable data cannot be changed once created, leading to much simpler application development, no defensive copying, and enabling advanced memoization techniques.

Immutable provides List, Stack, Map, OrderedMap, and Set by using persistenthash maps tries and vector tries as popularized by Clojure and Scala. They achieve efficiency on modern JavaScript VMs by using structural sharing and minimizing the need to copy or cache data.

Immutable also provides a lazy Seq, allowing efficient chaining of collection methods like map and filter without creating intermediate representations. Create some Seqwith Range and Repeat.