Skip to content

isEmpty() function

与えられた値が空の値の場合は true を返し、それ以外の場合は false を返します。

Signature:

typescript
isEmpty: <T>(value: T) => boolean;

Example

ts
isEmpty({}); // true
isEmpty([]); // true
isEmpty(null); // true
isEmpty(undefined); // true
isEmpty(""); // true
isEmpty(new Map()); // true
isEmpty(new Set()); // true

isEmpty(0); // false
isEmpty(false); // false
isEmpty(function () {}); // false
isEmpty(Symbol("")); // false
isEmpty(new Date()); // false

Open Source Code

Released under the Apache-2.0 License.