JavaScript: Map.prototype.has
New in JS2015.
mapObj.has(key)
-
Return
true
if key exist in mapObj. Else,false
.// check existence const xx = new Map([[4, "n4"], [5, "n5"]]); console.log(xx.has(5)); console.log(xx.has(99) === false);
New in JS2015.
mapObj.has(key)
true
if key exist in mapObj. Else, false
.
// check existence const xx = new Map([[4, "n4"], [5, "n5"]]); console.log(xx.has(5)); console.log(xx.has(99) === false);