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
Si reemplazo "arr[index]" con "arr[items]", obtengo una matriz con los valores de [2, 0, 3, 4], ¿alguien puede explicar qué está pasando?

 const ary = [1, 5, 3] ary.forEach(mult) function mult(items, index, arr) { arr[items] = index * 2; } console.log(ary)

about 4 years ago · Santiago Trujillo
1 answers
Answer question

0

[1, 5, 3]

En los elementos de inicio = 1 índice = 0

matriz[1]= 0*2 i,e 0

[1,0,3]

entonces los elementos se convierten en 0 índice = 1
matriz[0]= 1*2 i,e 2

[2,0,3]

entonces los elementos se convierten en 3 índice = 2
matriz[3]= 2*2 i,e 4

arr[2] permanece igual

los artículos se cambian cuando se modifica arr[items]

about 4 years ago · Santiago Trujillo 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!