I have an array of strings in a specific order and would like to arrange a different array of objects to match the original array order.
var arrangement = ["third", "first" "second"];
var myObjs = [
{
name: "thing",
position: "first"
},
{
name: "thing",
position: "second"
},
{
name: "thing",
position: "third"
}
];
So that the output would be:
var myObjs = [
{
name: "thing",
position: "third"
},
{
name: "thing",
position: "first"
},
{
name: "thing",
position: "second"
}
];
Any ideas on a good way to approach this?
Cheers,