Category
The Map
to check
true
if map
is empty, false
otherwise
Map
isEmpty(new Map([1, 2, 3])); // false
isEmpty(new Map()); // true
Category
Check if a Map
is empty.
Time complexity: O(1)
Space complexity: O(1)
The Map
to check
true
if map
is empty, false
otherwise
Map
isEmpty(new Map([['a', 1], ['b', 2], ['c', 3]])); // false
isEmpty(new Map()); // true
Category
Check if a readonly Set
is empty.
Time complexity: O(1)
Space complexity: O(1)
The Set
to check
true
if set
is empty, false
otherwise
Set
isEmpty(new Set([1, 2, 3])); // false
isEmpty(new Set()); // true
Category
Check if a Set
is empty.
Time complexity: O(1)
Space complexity: O(1)
The Set
to check
true
if set
is empty, false
otherwise
Set
isEmpty(new Set([1, 2, 3])); // false
isEmpty(new Set()); // true
Category
Check if a string is empty.
Time complexity: O(1)
Space complexity: O(1)
The string to check
true
if string
is empty, false
otherwise
String
isEmpty('hello'); // false
isEmpty(''); // true
Category
Check if a readonly array is empty.
Time complexity: O(1)
Space complexity: O(1)
The array to check
true
if array
is empty, false
otherwise
Array
isEmpty([1, 2, 3]); // false
isEmpty([]); // true
Category
Check if an array is empty.
Time complexity: O(1)
Space complexity: O(1)
The array to check
true
if array
is empty, false
otherwise
Array
isEmpty([1, 2, 3]); // false
isEmpty([]); // true
Category
Check if an iterable is empty.
Time complexity: O(1)
Space complexity: O(1)
The iterable to check
true
if iterable
is empty, false
otherwise
Iterable
isEmpty([1, 2, 3]); // false
isEmpty([]); // true
Check if a readonly
Map
is empty.Time complexity: O(1)
Space complexity: O(1)