pętla JavaScript przez tablicę
var colors = ["red","blue","green"];
colors.forEach(function(color) {
console.log(color);
});
Gifted Gerenuk
var colors = ["red","blue","green"];
colors.forEach(function(color) {
console.log(color);
});
//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