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

130
Views
Javascript: cómo obtener valores de una matriz en ciertas posiciones de índice

Tengo una matriz de valores.

 arr = ["a","b","c","d"]

y tengo otra matriz de índices

 indexes = [0,2]

¿Cuál es la mejor manera de obtener los valores de la matriz en estos índices?

Si aplico el método a los valores anteriores

debería volver

 ["a","c"]
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Utilice Array.map :

 arr = ["a","b","c","d"] indexes = [0,2] const res = indexes.map(e => arr[e]) console.log(res)

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!