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

143
Views
For loop over nested array está poniendo el último valor de i en el elemento en lugar del actual
export function func() { const test = new Array(2).fill(new Array(2)) for (let i = 0; i < test.length; i++) { test[i][0] = i; } console.log(test) return -1; }

me da [[1, undefined], [1, undefined]] en lugar de [[0, undefined], [1, undefined]]

Tan confundido en cuanto a por qué alguien puede explicar? ¿O me estoy perdiendo algo obvio?

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!