Checks if a given value is Set.
Set
This function can also serve as a type predicate in TypeScript, narrowing the type of the argument to Set.
The value to check if it is a Set.
Returns true if value is a Set, else false.
true
value
false
const value1 = new Set();const value2 = new Map();const value3 = new WeakSet();console.log(isSet(value1)); // trueconsole.log(isSet(value2)); // falseconsole.log(isSet(value3)); // false Copy
const value1 = new Set();const value2 = new Map();const value3 = new WeakSet();console.log(isSet(value1)); // trueconsole.log(isSet(value2)); // falseconsole.log(isSet(value3)); // false
Alias