Having the following array, it defines the sorting :
[300, 450, 345, 23]
And the following array, unsorted :
[
{id: 450, title: 'rand1'},
{id: 23, title: 'rand3'},
{id: 300, title: 'rand0'},
{id: 345, title: 'rand2'},
]
I'd like the first array to be a "rule" to sort my second array (probably by matching the id key).
How can i get achieve this cleanly ?