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