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

120
Views
how for create double loop in javascript with if condition
for (var o = 1; o <= 10000; o++) {
    alert("also result "+o)
for (var p = 1; p <= 10000; p++) {
    alert("result "+p)
    if (p % 11 == 0) {
        break;
    }
    }
}

i want to result like this

result 1 also result 1

result 2 also result 1

result 3 also result 1

result 4 also result 1

result 5 also result 1

result 6 also result 1

result 7 also result 1

result 8 also result 1

result 9 also result 1

result 10 also result 1

result 11 also result 2

result 12 also result 2

result 13 also result 2

result 14 also result 2

result 15 also result 2

result 16 also result 2

result 17 also result 2

result 18 also result 2

result 19 also result 2

result 20 also result 2

result 21 also result 3

result 22 also result 3

result 23 also result 3

result 24 also result 3

result 25 also result 3

result 26 also result 3

result 27 also result 3

result 28 also result 3

result 29 also result 3

result 30 also result 3

how to create loop in javascript,,please help me?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

This task can be solved without nested loops

for (let i = 1; i <= 10000; i++) {
  console.log(`result ${i} also result ${Math.floor((i - 1) / 10) + 1}`)
}
about 4 years ago · Juan Pablo Isaza Report
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!