Skip to content

isEmpty

Return true if the given value is empty. Empty values include: - `null` - `undefined` - `0` - `NaN` - `''` - `[]` - `{}` - invalid `Date` time - object with `length` property of `0` - object with `size` property of `0` - object with no enumerable keys

Usage

isEmpty(0); // => true
isEmpty(null); // => true
isEmpty(undefined); // => true
isEmpty([]); // => true
isEmpty({}); // => true

Installation

Terminal window
npx atmx add helper is-empty