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

Il metodo entries() restituisce un nuovo oggetto Array Iterator contenente delle coppie chiave/valore per ogni indice presente nell'array.

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

Sintassi

+ +
a.entries()
+ +

Valore ritornato

+ +

Un nuovo oggetto iterator {{jsxref("Array")}}.

+ +

Esempi

+ +

Utilizzo nel 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']
+
+ +

Specifiche

+ + + + + + + + + + + + + + + + + + + +
SpecificaStatoCommento
{{SpecName('ES2015', '#sec-array.prototype.entries', 'Array.prototype.entries')}}{{Spec2('ES2015')}}Definizione iniziale.
{{SpecName('ESDraft', '#sec-array.prototype.entries', 'Array.prototype.entries')}}{{Spec2('ESDraft')}} 
+ +

Compatibilità con il browser

+ +
+ + +

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

+
+ +

Vedi anche

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