Checks if an object, array, string, or collection is empty.
The type of the value to check.
The value to check for emptiness.
true if the value is empty, false otherwise.
true
false
// ES Moduleimport { isEmpty } from '@bnidev/js-utils'// CommonJSconst { isEmpty } = require('@bnidev/js-utils') Copy
// ES Moduleimport { isEmpty } from '@bnidev/js-utils'// CommonJSconst { isEmpty } = require('@bnidev/js-utils')
isEmpty({}) // trueisEmpty([]) // trueisEmpty('') // trueisEmpty({ a: 1 }) // falseisEmpty([1, 2]) // false Copy
isEmpty({}) // trueisEmpty([]) // trueisEmpty('') // trueisEmpty({ a: 1 }) // falseisEmpty([1, 2]) // false
Checks if an object, array, string, or collection is empty.