@bnidev/js-utils
    Preparing search index...

    Function isEmpty

    • Checks if an object, array, string, or collection is empty.

      Type Parameters

      • T

        The type of the value to check.

      Parameters

      • value: T

        The value to check for emptiness.

      Returns boolean

      true if the value is empty, false otherwise.

      // ES Module
      import { isEmpty } from '@bnidev/js-utils'

      // CommonJS
      const { isEmpty } = require('@bnidev/js-utils')
      isEmpty({}) // true
      isEmpty([]) // true
      isEmpty('') // true
      isEmpty({ a: 1 }) // false
      isEmpty([1, 2]) // false