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

225
Vistas
What is the differences between these two for loops?

Both of the consolt results are same. Anyone can explain me why it is being like that?

console result

for (let index = 0; index < 5; index++) {
  console.log(index)
}
for (let index = 0; index < 5; ++index) {
  console.log(index)
}
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

First loop use post, and second loop use pre increment. The desc like this ++index (pre-increment) means "increment the variable; the value of the expression is the final value" Index++ (post-increment) means "remember the original value, then increment the variable; the value of the expression is the original value"

Or u can follow this link https://stackoverflow.com/a/3469896/17123841

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