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

110
Views
Hello everyone, I am working through a program and stuck on a challenge and cannot figure out why this will not work

Task: Use a for loop to iterate through the array and increase each number by two.

const increaseByTwo = [1, 2, 3, 4, 5];

What is wrong with my code here?

for (let i = 0; i < increaseByTwo.length; i+=2){ 
  
}
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

is this what you need?

const increaseByTwo = [1, 2, 3, 4, 5];
var newArr = [];
increaseByTwo.forEach(e=>newArr.push(e+2))

console.log(newArr)

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!