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 Latest Draft (ECMA-262) Die Definition von 'Map.prototype.values' in dieser Spezifikation. |
Entwurf |
Browserkompatibilität
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.
Update compatibility data on GitHub
| Desktop | Mobile | Server | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
values | Chrome Vollständige Unterstützung 38 | Edge Vollständige Unterstützung 12 | Firefox Vollständige Unterstützung 20 | IE Keine Unterstützung Nein | Opera Vollständige Unterstützung 25 | Safari Vollständige Unterstützung 8 | WebView Android Vollständige Unterstützung 38 | Chrome Android Vollständige Unterstützung 38 | Firefox Android Vollständige Unterstützung 20 | Opera Android Vollständige Unterstützung 25 | Safari iOS Vollständige Unterstützung 8 | Samsung Internet Android Vollständige Unterstützung 3.0 | nodejs Vollständige Unterstützung 0.12 |
Legende
- Vollständige Unterstützung
- Vollständige Unterstützung
- Keine Unterstützung
- Keine Unterstützung