aboutsummaryrefslogtreecommitdiff
path: root/files/es/web/javascript/reference/global_objects/array/entries/index.html
diff options
context:
space:
mode:
authorFlorian Dieminger <me@fiji-flo.de>2021-02-11 18:20:58 +0100
committerGitHub <noreply@github.com>2021-02-11 18:20:58 +0100
commit2318b37e3fd17a3e76a29b9be7d1ce82f040c3bb (patch)
tree5e640d40fd69dc380b04e01de981a345e0141ffa /files/es/web/javascript/reference/global_objects/array/entries/index.html
parent6aa6274d2ad3e22e7f5e69b1d7531a5eaeaf5666 (diff)
parent8a5554c6fae83e92b10c8dbe5b82108cb44fad6c (diff)
downloadtranslated-content-2318b37e3fd17a3e76a29b9be7d1ce82f040c3bb.tar.gz
translated-content-2318b37e3fd17a3e76a29b9be7d1ce82f040c3bb.tar.bz2
translated-content-2318b37e3fd17a3e76a29b9be7d1ce82f040c3bb.zip
Merge pull request #53 from fiji-flo/unslugging-es
Unslugging es
Diffstat (limited to 'files/es/web/javascript/reference/global_objects/array/entries/index.html')
-rw-r--r--files/es/web/javascript/reference/global_objects/array/entries/index.html87
1 files changed, 87 insertions, 0 deletions
diff --git a/files/es/web/javascript/reference/global_objects/array/entries/index.html b/files/es/web/javascript/reference/global_objects/array/entries/index.html
new file mode 100644
index 0000000000..3db699e1d5
--- /dev/null
+++ b/files/es/web/javascript/reference/global_objects/array/entries/index.html
@@ -0,0 +1,87 @@
+---
+title: Array.prototype.entries()
+slug: Web/JavaScript/Reference/Global_Objects/Array/entries
+tags:
+ - Array
+ - ECMAScript 2015
+ - Iterador
+ - Iterator
+ - JavaScript
+ - Prototipo
+ - metodo
+translation_of: Web/JavaScript/Reference/Global_Objects/Array/entries
+original_slug: Web/JavaScript/Referencia/Objetos_globales/Array/entries
+---
+<div>{{JSRef}}</div>
+
+<div>El método <code><strong>entries()</strong></code> retorna un nuevo objeto <strong><code>Array Iterator</code></strong> que contiene los pares clave/valor para cada índice de la matriz.</div>
+
+<div> </div>
+
+<div>
+<p>{{EmbedInteractiveExample("pages/js/array-entries.html")}}</p>
+</div>
+
+<h2 id="Sintaxis">Sintaxis</h2>
+
+<pre class="syntaxbox"><var>arr</var>.entries()</pre>
+
+<h3 id="Valor_de_retorno">Valor de retorno</h3>
+
+<p>Un nuevo objeto iterador {{jsxref("Array")}}.</p>
+
+<h2 id="Ejemplos">Ejemplos</h2>
+
+<h3 id="Usando_un_bucle_for…of">Usando un bucle <a href="/es/docs/Web/JavaScript/Reference/Statements/for...of">for…of</a> </h3>
+
+<pre class="brush: js">var a = ['a', 'b', 'c'];
+var iterator = a.entries();
+
+for (let e of iterator) {
+ console.log(e);
+}
+// [0, 'a']
+// [1, 'b']
+// [2, 'c']</pre>
+
+<h2 id="Especificaciones">Especificaciones</h2>
+
+<table class="standard-table">
+ <tbody>
+ <tr>
+ <th scope="col">Especificación</th>
+ <th scope="col">Estado</th>
+ <th scope="col">Comentarios</th>
+ </tr>
+ <tr>
+ <td>{{SpecName('ES6', '#sec-array.prototype.entries', 'Array.prototype.entries')}}</td>
+ <td>{{Spec2('ES6')}}</td>
+ <td>Definición inicial.</td>
+ </tr>
+ <tr>
+ <td>{{SpecName('ESDraft', '#sec-array.prototype.entries', 'Array.prototype.entries')}}</td>
+ <td>{{Spec2('ESDraft')}}</td>
+ <td> </td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="Compatibilidad_con_navegadores">Compatibilidad con navegadores</h2>
+
+<div>
+<p>{{Compat("javascript.builtins.Array.entries")}}</p>
+</div>
+
+<div id="compat-mobile"> </div>
+
+<h2 id="Ver_también">Ver también</h2>
+
+<ul>
+ <li>{{jsxref("Array.prototype.keys()")}}</li>
+ <li>{{jsxref("Array.prototype.values()")}}</li>
+ <li>{{jsxref("Array.prototype.forEach()")}}</li>
+ <li>{{jsxref("Array.prototype.every()")}}</li>
+ <li>{{jsxref("Array.prototype.some()")}}</li>
+ <li><a href="/es/docs/Web/JavaScript/Reference/Statements/for...of">for...of</a></li>
+ <li><a href="/es/docs/Web/JavaScript/Reference/Iteration_protocols">Protocolos de iteración</a></li>
+</ul>