immutable-array.push
provides a function that returns the concatenation of an immutable array with an item.
$ npm install immutable-array.push --save
const ImmutableArray = {
of: require('immutable-array.of'),
push: require('immutable-array.push')
}
const a = ImmutableArray.of([1, 2, 3, 4, 5]) // {array: [1, 2, 3, 4, 5], length: 5}
const b = ImmutableArray.push(6, a) // {array: [1, 2, 3, 4, 5, 6], length: 6}
a // {array: [1, 2, 3, 4, 5, 6], length: 5}
- Node.js >=6
- ES2015 transpilers
MIT