Hello, along with saying hello, I wanted to see how I can filter an array depending on another array:
array1: [
{id: 3, name: peter},
{id: 1, name: jonh},
{id: 2, name: jupiter}
]
array2: [
{id: 1, name: jonh},
{id: 2, name: jupiter},
{id: 3, name: peter}
]
The code im looking for is:
array 2 always should keep the order of they "id" of array 1. So array 2 should be 3 | 1 | 2, what code should add after the declaration of array 2, to sort in that way?