I have array visitors
with 1000 records.
In this array I look for and element by _found.idVisitor
:
let index = this.visitors.findIndex(
st => st.idVisitor === _found.idVisitor
);
this.visitors.splice(index, 1);
this.visitors.unshift(_found);
Then I pull this element by index and push to the top of array?
But this approach take long time, how to optimize it?