Die values()
Methode gibt ein neues Iterator Objekt mit allen Werten aller Elemente des Map
Objektes 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.values()
Rückgabewert
Ein neues Map
Iterator Objekt.
Beispiele
Einsatz von values()
var myMap = new Map();
myMap.set('0', 'foo');
myMap.set(1, 'bar');
myMap.set({}, 'baz');
var mapIter = myMap.values();
console.log(mapIter.next().value); // "foo"
console.log(mapIter.next().value); // "bar"
console.log(mapIter.next().value); // "baz"
Spezifikationen
Spezifikation | Status | Kommentar |
---|---|---|
ECMAScript 2015 (6th Edition, ECMA-262) Die Definition von 'Map.prototype.values' in dieser Spezifikation. |
Standard | Initiale Definition. |
ECMAScript (ECMA-262) Die Definition von 'Map.prototype.values' in dieser Spezifikation. |
Lebender Standard |
Browserkompatibilität
BCD tables only load in the browser