Die entries()
Methode gibt ein neues Iterator Objekt mit allen [Schlüssel, Wert]
Paaren von jedem Element in dem Map
Objekt in Einfügereihenfolge zurück.
The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request.
Syntax
myMap.entries()
Rückgabewert
Ein neues Map
Iterator Objekt.
Beispiele
Einsatz von entries()
var myMap = new Map();
myMap.set('0', 'foo');
myMap.set(1, 'bar');
myMap.set({}, 'baz');
var mapIter = myMap.entries();
console.log(mapIter.next().value); // ["0", "foo"]
console.log(mapIter.next().value); // [1, "bar"]
console.log(mapIter.next().value); // [Object, "baz"]
Spezifikationen
Spezifikation | Status | Kommentar |
---|---|---|
ECMAScript 2015 (6th Edition, ECMA-262) Die Definition von 'Map.prototype.entries' in dieser Spezifikation. |
Standard | Initiale Definition. |
ECMAScript (ECMA-262) Die Definition von 'Map.prototype.entries' in dieser Spezifikation. |
Lebender Standard |
Browserkompatibilität
BCD tables only load in the browser