Returns a copy of the collection with the value at the key path set to the provided value.
setIn<C>(collection: C, keyPath: Iterable<unknown>, value: unknown): C
A functional alternative to collection.setIn(keypath)
which will also
work with plain Objects and Arrays.
const { setIn } = require('immutable')
const original = { x: { y: { z: 123 }}}
setIn(original, ['x', 'y', 'z'], 456) // { x: { y: { z: 456 }}}
console.log(original) // { x: { y: { z: 123 }}}run it