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

104
Views
Problems with code in JavaScript with loops

I learn loops in JavaScript with for-loop and I have this code (j) that does not work with me I don’t know why?

let start = 1;
let end = 6;
let breaker = 2;

for (let i = start; i <= end; i++) {
  console.log(i);
  for (let j = breaker; j <= end; i++) {
    console.log(j);
  }
}
about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

You never increase j thus you get endless loop, try replacing

for(let j = breaker; j <= end; i++)

using

for(let j = breaker; j <= end; j+=1)
about 4 years ago · Juan Pablo Isaza Report

0

You changed i and j in inner loop

let start = 1;    
let end = 6;    
let breaker = 2;


for (let i = start; i <= end; i++) 
{
    console.log("i => ", i);
    for(let j = breaker; j <= end; j++)
    {
        console.log("j => ", j);
    }
}

`

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!