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

112
Views
acceso al elemento anterior en elemento de arreglos

Explico mi pregunta con un ejemplo:

 myArray=[10,15,42,74,65,2,7,9]

Entonces, ¿cómo puedo acceder a Todos los elementos, por ejemplo, antes del elemento '65'?

 newArray=[10,15,42,74]
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Puede usar Array.slice(start, length) para obtener solo una parte de su matriz original y Array.indexOf() para obtener el índice del número 65.

 let array = [10, 15, 42, 74, 65, 2, 7, 9] // 0, because you want to start on the first index (10) let newArray = array.slice(0, array.indexOf(65))
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!