Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

135
Vistas
About for loop result why out of block console will over loop range?

a simple for loop like this.

document is print 0 to 10

but why console is 11, not 10?

for(var i=0; i<=10; i++){
      document.write(i);
    }

    console.log(i);

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Because the loop adds one stores the value. It then checks the condition after it incremented the value. It the condition is met, it enters the loops body. If it is not met, it exits out.

iteration i = 10, 10 <= 10.... okay, enter loop's body

next iteration, i = 11, 11 <= 10.... okay it is not so exit the loop.

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda