JS: Map.prototype.has
(new in JS: ECMAScript 2015)
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);
JS Map.prototype
- JS: Map.prototype.constructor
- JS: Map.prototype.size
- JS: Map.prototype[Symbol.toStringTag]
- JS: Map.prototype.get
- JS: Map.prototype.set
- JS: Map.prototype.has
- JS: Map.prototype.delete
- JS: Map.prototype.clear
- JS: Map.prototype.forEach
- JS: Map.prototype.keys
- JS: Map.prototype.values
- JS: Map.prototype.entries