Die size
Zugriffseigenschaft gibt die Anzahl der Elemente in einem Map
Objekt 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.
Beschreibung
Der Wert von size
ist eine ganze Zahl, die angibt, wie viele Einträge ein Map
Objekt hat. Die set-Zugriffsfunktion für size
ist undefined
; diese Eigenschaft kann nicht geändert werden.
Beispiele
Einsatz von size
var myMap = new Map(); myMap.set('a', 'alpha'); myMap.set('b', 'beta'); myMap.set('g', 'gamma'); myMap.size // 3
Spezifikationen
Spezifikation | Status | Kommentar |
---|---|---|
ECMAScript 2015 (6th Edition, ECMA-262) Die Definition von 'Map.prototype.size' in dieser Spezifikation. |
Standard | Initiale Definition. |
ECMAScript Latest Draft (ECMA-262) Die Definition von 'Map.prototype.size' 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 | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
size | Chrome Vollständige Unterstützung 38 | Edge Vollständige Unterstützung 12 | Firefox
Vollständige Unterstützung
19
| IE Vollständige Unterstützung 11 | 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
19
| 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
- Siehe Implementierungshinweise.
- Siehe Implementierungshinweise.