I have an associative array, with a number used as key, something like this:
let array1 = [
[456, {
"field1": "value1",
"field2": "value2",
}],
[789, {
"field1": "value1",
"field2": "value2",
}],
[123, {
"field1": "value1",
"field2": "value2",
}]
];
and then I have another simply array like this:
let array2 = [123, 456, 789];
is there a way to order array1 accordingly to array2?