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/values/index.html | 86 ++++++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 files/de/web/javascript/reference/global_objects/array/values/index.html (limited to 'files/de/web/javascript/reference/global_objects/array/values') diff --git a/files/de/web/javascript/reference/global_objects/array/values/index.html b/files/de/web/javascript/reference/global_objects/array/values/index.html new file mode 100644 index 0000000000..3736af04f8 --- /dev/null +++ b/files/de/web/javascript/reference/global_objects/array/values/index.html @@ -0,0 +1,86 @@ +--- +title: Array.prototype.values() +slug: Web/JavaScript/Reference/Global_Objects/Array/values +tags: + - Array + - ECMAScript 2015 + - Iterator + - JavaScript + - Method + - Prototype +translation_of: Web/JavaScript/Reference/Global_Objects/Array/values +--- +
{{JSRef}}
+ +

Die values() Methode gibt ein neues Iterator Objekt des Arrays zurück, welches die Werte für jeden Eintrag im Array enthält.

+ +

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

+ +
var a = ['w', 'y', 'k', 'o', 'p'];
+var iterator = a.values();
+
+console.log(iterator.next().value); // w
+console.log(iterator.next().value); // y
+console.log(iterator.next().value); // k
+console.log(iterator.next().value); // o
+console.log(iterator.next().value); // p
+ +

Syntax

+ +
arr.values()
+ +

Rückgabewert

+ +

Ein neues {{jsxref("Iterator")}} Objekt von dem Array.

+ +

Beispiele

+ +

Benutzung der for...of loop

+ +
var arr = ['w', 'y', 'k', 'o', 'p'];
+var iterator = arr.values();
+
+for (let letter of iterator) {
+  console.log(letter);
+}
+
+ +

Spezifikationen

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

Browserkompatibilität

+ +
+ + +

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

+
+ +

Siehe auch

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