removeIn()

Returns a copy of the collection with the value at the key path removed.

removeIn<C>(collection: C, keyPath: Iterable<unknown>): C

Discussion

A functional alternative to collection.removeIn(keypath) which will also work with plain Objects and Arrays.

const { removeIn } = require('immutable') const original = { x: { y: { z: 123 }}} removeIn(original, ['x', 'y', 'z']) // { x: { y: {}}} console.log(original) // { x: { y: { z: 123 }}}run it
This documentation is generated from immutable.d.ts. Pull requests and Issues welcome.