From 074785cea106179cb3305637055ab0a009ca74f2 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:42:52 -0500 Subject: initial commit --- .../global_objects/array/entries/index.html | 132 +++++++++++++++++++++ 1 file changed, 132 insertions(+) create mode 100644 files/nl/web/javascript/reference/global_objects/array/entries/index.html (limited to 'files/nl/web/javascript/reference/global_objects/array/entries') diff --git a/files/nl/web/javascript/reference/global_objects/array/entries/index.html b/files/nl/web/javascript/reference/global_objects/array/entries/index.html new file mode 100644 index 0000000000..add0b7439a --- /dev/null +++ b/files/nl/web/javascript/reference/global_objects/array/entries/index.html @@ -0,0 +1,132 @@ +--- +title: Array.prototype.entries() +slug: Web/JavaScript/Reference/Global_Objects/Array/entries +tags: + - Array + - ECMAScript 2015 + - Iterator + - JavaScript + - Méthode + - Prototype +translation_of: Web/JavaScript/Reference/Global_Objects/Array/entries +--- +
{{JSRef}}
+ +

De entries() funtie geeft een nieuw Array Iterator object dat de key/value paren bevat voor elk onderdeel van de array.

+ +
var a = ['a', 'b', 'c'];
+var iterator = a.entries();
+
+console.log(iterator.next().value); // [0, 'a']
+console.log(iterator.next().value); // [1, 'b']
+console.log(iterator.next().value); // [2, 'c']
+
+ +

Syntax

+ +
a.entries()
+ +

Return waarde

+ +

Een nieuw {{jsxref("Array")}} iterator object.

+ +

Voorbeelden

+ +

De for…of loop

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

Specificaties

+ + + + + + + + + + + + + + + + + + + +
SpecificatieStatusOpmerkingen
{{SpecName('ES6', '#sec-array.prototype.entries', 'Array.prototype.entries')}}{{Spec2('ES6')}}Standaard definitie.
{{SpecName('ESDraft', '#sec-array.prototype.entries', 'Array.prototype.entries')}}{{Spec2('ESDraft')}} 
+ +

Browser compatibiliteit

+ +
{{CompatibilityTable}}
+ +
+ + + + + + + + + + + + + + + + + + + +
FunctieChromeFirefox (Gecko)Internet ExplorerOperaSafari
Basis ondersteuning{{CompatChrome("38")}}{{CompatGeckoDesktop("28")}}{{CompatNo}}{{CompatOpera("25")}}{{CompatSafari("7.1")}}
+
+ +
+ + + + + + + + + + + + + + + + + + + + + +
FunctieAndroidChrome voor AndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Basis ondersteuning{{CompatNo}}{{CompatNo}}{{CompatGeckoMobile("28")}}{{CompatNo}}{{CompatNo}}8.0
+
+ +

Zie ook

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