From 4b1a9203c547c019fc5398082ae19a3f3d4c3efe Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:41:15 -0500 Subject: initial commit --- .../global_objects/array/entries/index.html | 84 ++++++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 files/de/web/javascript/reference/global_objects/array/entries/index.html (limited to 'files/de/web/javascript/reference/global_objects/array/entries/index.html') diff --git a/files/de/web/javascript/reference/global_objects/array/entries/index.html b/files/de/web/javascript/reference/global_objects/array/entries/index.html new file mode 100644 index 0000000000..2bd4fb9942 --- /dev/null +++ b/files/de/web/javascript/reference/global_objects/array/entries/index.html @@ -0,0 +1,84 @@ +--- +title: Array.prototype.entries() +slug: Web/JavaScript/Reference/Global_Objects/Array/entries +tags: + - Array + - ECMAScript 2015 + - Iterator + - JavaScript + - Method + - Prototype +translation_of: Web/JavaScript/Reference/Global_Objects/Array/entries +--- +
{{JSRef}}
+ +

Die entries() Methode gibt ein neues Array Iterator Objekt zurück, das Schlüssel-Wert-Paare für jeden Index im Array enthält.

+ +
{{EmbedInteractiveExample("pages/js/array-entries.html")}}
+ + + +

Syntax

+ +
arr.entries()
+ +

Rückgabewert

+ +

Ein neues {{jsxref("Array")}}-iterator Objekt.

+ +

Beispiele

+ +

Einsatz einer for…of Schleife

+ +
var a = ['a', 'b', 'c'];
+var iterator = a.entries();
+
+for (let e of iterator) {
+  console.log(e);
+}
+// [0, 'a']
+// [1, 'b']
+// [2, 'c']
+
+ +

Spezifikationen

+ + + + + + + + + + + + + + + + + + + +
SpezifikationStatusKommentar
{{SpecName('ES6', '#sec-array.prototype.entries', 'Array.prototype.entries')}}{{Spec2('ES6')}}Initiale Definition.
{{SpecName('ESDraft', '#sec-array.prototype.entries', 'Array.prototype.entries')}}{{Spec2('ESDraft')}} 
+ +

Browserkompatibilität

+ +
+ + +

{{Compat("javascript.builtins.Array.entries")}}

+
+ +

Siehe auch

+ + -- cgit v1.2.3-54-g00ecf