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

173
Views
JS: Move items in array with fixed position items

I have an array

[ {name: "A", isMoveable: true},
  {name: "B", isMoveable: true},
  {name: "C", isMoveable: false},
  {name: "D", isMoveable: true},
  {name: "E", isMoveable: false}
]

I have drag and drop so we need an algorithm that moves elements, those with isMoveable: true while keeping elements with isMoveable: false at the same indexes for example, if I move A before C, it will be like this [B,A,C,D,E] if A in place of D, then [D,B,C,A,E]

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!