Answers for "ciclo for javascript"

1

ciclo for javascript

//Ejemplo de ciclo for
var colores=["rojo","azul","verde"];
for (let i = 0; i < colores.length; i++) { 
  console.log(colores[i]);
}
//Se espera que imprima: rojo azul verde
Posted by: Guest on June-20-2021
14

javascript loop through array

var colors = ["red","blue","green"];
colors.forEach(function(color) {
  console.log(color);
});
Posted by: Guest on March-06-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language