JS: Map.prototype.keys
(new in JS: ECMAScript 2015)
mapObj.keys()
-
Return a Generator for the keys in the map.
console.log( JSON.stringify( Array.from( (new Map([[3, "n3"], [4, "n4"], [5, "n5"]])).keys(), ), ) === `[3,4,5]`, );
Verify Result is a Generator
// verify the result is iterator and iterable const xx = (new Map([[1, 2], [3, 4]])).keys(); // is iterable console.log(Reflect.has(xx, Symbol.iterator)); // true // is iterator console.log(Reflect.has(xx, "next")); // true
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