Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

157
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!