Question:
I don’t really know how to explain my problem so sorry for the title.I have three JavaScript arrays:
originalPos
array by using newData
array like this :L.routing.machine.spliceWaypoints()
Answer:
You can rearrange by finding the position of every element oforiginalPos
in originalData
and with that respective position you can push the element from newData
into the result array.Assuming there is no duplicate data within all three arrays
If you have better answer, please add a comment about this, thank you!