JavaScript: Map.prototype.has

By Xah Lee. Date: . Last updated: .

New in JS2015.

map_obj.has(key)
Return true if key exist in map_obj. Else, false.
// check existence
const m = new Map([ [4, "n4"], [5, "n5"] ]);
console.log (m.has (5)); // true
console.log (m.has (99)); // false
JS in Depth
XAH  BUY NOW

JS in Depth

JS Obj Ref

DOM


JS Obj Ref

Map

prototype