Merge pull request #954 from skatcat31/skatcat31-isEmpty
Maps and Sets are not collections, but Stores
This commit is contained in:
@ -1,6 +1,6 @@
|
|||||||
### isEmpty
|
### isEmpty
|
||||||
|
|
||||||
Returns true if the a value is an empty object, collection, map or set, has no enumerable properties or is any type that is not considered a collection.
|
Returns true if the a value is an empty object, collection, has no enumerable properties or is any type that is not considered a collection.
|
||||||
|
|
||||||
Check if the provided value is `null` or if its `length` is equal to `0`.
|
Check if the provided value is `null` or if its `length` is equal to `0`.
|
||||||
|
|
||||||
@ -9,8 +9,6 @@ const isEmpty = val => val == null || !(Object.keys(val) || val).length;
|
|||||||
```
|
```
|
||||||
|
|
||||||
```js
|
```js
|
||||||
isEmpty(new Map()); // true
|
|
||||||
isEmpty(new Set()); // true
|
|
||||||
isEmpty([]); // true
|
isEmpty([]); // true
|
||||||
isEmpty({}); // true
|
isEmpty({}); // true
|
||||||
isEmpty(''); // true
|
isEmpty(''); // true
|
||||||
|
|||||||
Reference in New Issue
Block a user