hasIn()

Returns true if the key path is defined in the provided collection.

hasIn(collection: unknown, keyPath: Iterable<unknown>): boolean

Discussion

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

const { hasIn } = require('immutable') hasIn({ x: { y: { z: 123 }}}, ['x', 'y', 'z']) // true hasIn({ x: { y: { z: 123 }}}, ['x', 'q', 'p']) // falserun it
This documentation is generated from immutable.d.ts. Pull requests and Issues welcome.