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

158
Vistas
Can someone correct my understanding of how do-while-loop work

I hope everyone is doing well

I am going to share my understanding of how do-while loop work and i need YOU guys to tell am i,right or not?

Here is the code first:

let k= 1

do{
    if(k===9){
        k++;
        continue;
    }
    console.log(k+1);
    k= k+1;
}while(k<15);

So what this code does is it takes k=1 and in console.log(k+1) , it prints k = 2. And then 1 is added to K original value of 1 and it checks whether the condition is true or not.

If its true, then it will move forward to make another loop and check it.

And when k value reaches to 9, the IF condition becomes true and k++ adds 1 to 9 which is equal to 10 and before printing 10, continue statement terminate that loop and start another loop.

This is what i understood on how it works.

Thanks

about 4 years ago · Juan Pablo Isaza
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