JS: Map.prototype.get
(new in ECMAScript 2015)
mapObj.get(key)-
Return the value of the key key in map mapObj.
If key isn't found, return undefined.
const xx = new Map([[4, "n4"], [5, "n5"]]); // get the value of a key console.assert(xx.get(5) === "n5"); console.assert(xx.get(99) === undefined);
JavaScript. Methods for map object
- JS: Map.groupBy
- JS: Map.prototype.size
- JS: Map.prototype.get
- JS: Map.prototype.getOrInsert
- JS: Map.prototype.getOrInsertComputed
- 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