Respuestas Ejercicio 21 (JS Julio)

Comparte tu respuesta del ejercicio 21.

const nums = [1, 23, 5, 8, 40, 12, 2, 67, 24, 9, 39]
for(let i=0;i<nums.length;i++){
  if(nums[i]>10){
    console.log(nums[i])
  }
}

Esta es mi solución:

const nums = [1, 23, 5, 8, 40, 12, 2, 67, 24, 9, 39]
for(let i=0;i<nums.length;i++){
  if(nums[i]>10){
    console.log(nums[i])
  }
}
const nums = [1, 23, 5, 8, 40, 12, 2, 67, 24, 9, 39]
for(num in nums){
  if (nums[num] > 10) 
    console.log(nums[num])
}

Aqui mi solucion:

const nums = [1, 23, 5, 8, 40, 12, 2, 67, 24, 9, 39]
// escribe tu código acá
for(let i=0; i<nums.length; i++){
  if(nums[i]>10) console.log(nums[i])
}

Mi solucion es:

const nums = [1, 23, 5, 8, 40, 12, 2, 67, 24, 9, 39]
for (i = 0; i < nums.length; i++) {
    if (nums[i] > 10) (console.log(nums[i]))
} 

Buenas noches:

const nums = [1, 23, 5, 8, 40, 12, 2, 67, 24, 9, 39]
for (index = 0; index <= nums.length-1; index++) {
 if (nums[index] > 10) {
   console.log(nums[index])
 }
} 

Buenas noches, a continuación envío el código del ejercicio

const nums = [11, 3, 51, 8, 4, 1, 21, 6, 4, 19, 9]
// escribe tu código acá
for(i=0;i<=nums.length;i++){
  if(nums[i]>10){
		console.log(nums[i])
  }
}
const nums = [1, 23, 5, 8, 40, 12, 2, 67, 24, 9, 39]
for (let i=0;i<nums.length;i++){
  if (nums[i]>10){
    console.log(nums[i])
  }
}
const nums = [1, 23, 5, 8, 40, 12, 2, 67, 24, 9, 39]
for(let i=0; i<nums.length; i++)
  if (nums[i] > 10) console.log(nums[i])

Mi respuesta:

const nums = [1, 23, 5, 8, 40, 12, 2, 67, 24, 9, 39];
for (item of nums) {
  if(item > 10) console.log(item);
}
// Arreglo propuesto
//const nums = [1, 23, 5, 8, 40, 12, 2, 67, 24, 9, 39];
//Arreglo nuevo de prueba
const nums = [65, 12, 7, 4, 33, 55, 1, 3, 9, 102, 89, 8, 76];
// escribe tu código acá
for(a=0; a<nums.length; a++){
  if(nums[a]>10){
    console.log(nums[a]);
  }
}
const nums = [1, 23, 5, 8, 40, 12, 2, 67, 24, 9, 39];
	for (let i = 0; i < nums.length; i++) {
	if (nums[i] > 10) {
		console.log(nums[i]);
	}
}
const nums = [1, 23, 5, 8, 40, 12, 2, 67, 24, 9, 39]
for(let i=0; i<nums.length; i++){
  if (nums[i] > 10) console.log(nums[i])
}
const nums = [1, 23, 5, 8, 40, 12, 2, 67, 24, 9, 39]
for(let i = 0; i < nums.length; i++){
  if(nums[i] > 10){
    console.log(nums[i])
  }
}
const nums = [1, 23, 5, 8, 40, 12, 2, 67, 24, 9, 39]
//const nums = [1, 5, 8, 2, 9, 10, 11]      //Prueba con otros números, el resultado debe ser solo imprimir 11

for(numero of nums){
  if(numero > 10){console.log(numero)}
}

Esta es mi solución:

const nums = [1, 23, 5, 8, 40, 12, 2, 67, 24, 9, 39]

for(let i=0; i < nums.length; i++){
  if(nums[i] > 10 ) console.log(nums[i])
}

Mi respuesta

const nums = [1, 23, 5, 8, 40, 12, 2, 67, 24, 9, 39]

  for (let i=0; i<nums.length;i++)
{  if (nums[i]>10){
  console.log(nums[i])
  }
}
const nums = [1, 23, 5, 8, 40, 12, 2, 67, 24, 9, 39,8,100,4,5,3,66,55,9,1,10]
for (const numero of nums) {
    if (numero>10) console.log(numero)
}

//ejercicio 21
const nums=[1,23,5,8,40,12,2,67,24,9,39]

for(let i=0;i<nums.length;i++){
if(nums[i]>10)
console.log(nums[i])
}