Tried to figure it out. Can't. I have 2 arrays, and I would like to sort the index of just one of them to match the index by its object.
Array 1 is as goes:
var arr1 = [
{
"name": "bobby",
"occupation": "singer"
},
{
"name": "mindy",
"occupation": "artist"
}
]
and Array 2:
var arr2 = [
{
"name": "mindy",
"hobby": "drawing"
},
{
"name": "bobby",
"hobby": "driving"
}
]
It doesn't really matter which one gets re-indexed. The point is I have two names bobby
and mindy
and I would like to re-arrange one of these arrays so that their index matches the other.