JS Utils Kit
    Preparing search index...

    Function isEmpty

    • Checks whether a value is empty.

      Empty values include:

      • null or undefined
      • Empty strings (including whitespace-only strings)
      • Arrays with length 0
      • Objects with no own enumerable properties
      • Maps and Sets with size 0

      Type Parameters

      • T

      Parameters

      • value: T

        The value to check.

      Returns boolean

      true if the value is empty, otherwise false

      isEmpty(null);        // true
      isEmpty(''); // true
      isEmpty(' '); // true
      isEmpty([]); // true
      isEmpty({}); // true
      isEmpty(new Map()); // true
      isEmpty('hello');    // false
      isEmpty([1]); // false
      isEmpty({ a: 1 }); // false