Skip to content

Latest commit

 

History

History
60 lines (46 loc) · 1.9 KB

isEmpty.md

File metadata and controls

60 lines (46 loc) · 1.9 KB

Object Agent

A javascript library for working with objects

npm build coverage deps size vulnerabilities license


isEmpty(item) ⇒ boolean

Tests if an object or array has any set keys. The values of each key are not considered.

Param Type Description
item unknown The item to test.

Example

import { isEmpty } from 'object-agent';

isEmpty(['a', 1, 'b']);
// => false

isEmpty([]);
// => true

isEmpty({ a: 'b' });
// => false

isEmpty({});
// => true

isEmpty(null);
// => true

isEmpty(undefined);
// => true