From 074785cea106179cb3305637055ab0a009ca74f2 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:42:52 -0500 Subject: initial commit --- .../referencje/obiekty/array/entries/index.html | 77 ++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 files/pl/web/javascript/referencje/obiekty/array/entries/index.html (limited to 'files/pl/web/javascript/referencje/obiekty/array/entries') diff --git a/files/pl/web/javascript/referencje/obiekty/array/entries/index.html b/files/pl/web/javascript/referencje/obiekty/array/entries/index.html new file mode 100644 index 0000000000..6ff83958f4 --- /dev/null +++ b/files/pl/web/javascript/referencje/obiekty/array/entries/index.html @@ -0,0 +1,77 @@ +--- +title: Array.prototype.entries() +slug: Web/JavaScript/Referencje/Obiekty/Array/entries +translation_of: Web/JavaScript/Reference/Global_Objects/Array/entries +--- +
{{JSRef}}
+ +

Metoda entries() zwraca obiekt Iteratora który zawiera parę klucz/wartość dla każdej pozycji w tablicy.

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

Składnia

+ +
a.entries()
+ +

Zwracana wartość

+ +

Nowy iterator {{jsxref("Tablicy")}}.

+ +

Przykłady

+ +

Użycie w pętli for…of

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

Specyfikacja

+ + + + + + + + + + + + + + + + + + + +
SpecyfikacjaStatusKomentarz
{{SpecName('ES2015', '#sec-array.prototype.entries', 'Array.prototype.entries')}}{{Spec2('ES2015')}}Initial definition.
{{SpecName('ESDraft', '#sec-array.prototype.entries', 'Array.prototype.entries')}}{{Spec2('ESDraft')}} 
+ +

Kompatybilność w przeglądarkach

+ +
+ + +

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

+
+ +

Zobacz również

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