You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: 1-js/05-data-types/04-array/article.md
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -507,4 +507,8 @@ Para iterar sobre los elementos de un array:
507
507
-`for (let item of arr)`-- la sintaxis moderna para items solamente.
508
508
-`for (let i in arr)`-- nunca lo uses.
509
509
510
+
Para comparar arrays, no uses el operador `==` (como tampoco `>`, `<` y otros), ya que no tienen un tratamiento especial para arrays. Lo manejan como cualquier objeto y no es lo que normalmente queremos.
511
+
512
+
En su lugar puedes utilizar el bucle `for..of` para comparar arrays elemento a elemento.
513
+
510
514
Volveremos a los arrays y estudiaremos más métodos para agregar, quitar, extraer elementos y ordenar arrays en el capítulo <info:array-methods>.
0 commit comments