Skip to content
This repository has been archived by the owner on Apr 1, 2023. It is now read-only.

Latest commit

 

History

History
60 lines (46 loc) · 1.86 KB

isEmpty.md

File metadata and controls

60 lines (46 loc) · 1.86 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
item *

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