I have an array of objects structured like so (this is just example) and an array of id:
var array_objects=[
{id:'a',value:1},
{id:'b',value:2},
{id:'c',value:2},
{id:'d',value:3}
];
var array =['b','c','a','d'];
I wish to reorder array_objects the same way array is ordered. The order in the array can change each time. How to do this?
array, referencingarray_objectsto create a new, sorted, array of objects