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

162
Views
How to get the next element from an array for a given subarray

I have an array ["a", "b", "c", "d", "e", "f"] and also an subarray ["a", "b", "c"] . Now the next element in the main array to subarray is d . So I want to get the array as ["a", "b", "c", "d"] .

I know there are so many ways to get this . Like

get length of subarray => 3
slice from main array `length of subarray + 1` => _.slice(main_array, 0, 4)

Is there any other elegant way to do this , I am preferably looking for solution using lodash.

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!