I have come across this issue more than once during my career. I have googled and have not found a precise match in those results or on StackOverflow. 

Consider that I have the following array of objects:

```
let objects = [
    {id: 'doe', descr: 'a deer'},
    {id: 'baz', descr: 'non-sense'},
    {id: 'ray', descr: 'a drop'},
    {id: 'foo', descr: 'effed'},
    {id: 'bar', descr: 'beyond'}
];

```

I would like to get only the array elements where `id` matches one of the elements of the following array, *and* returns them in an array that matches the *order* of the following:

```
let objectsOrder = ['foo', 'bar', 'baz'];

```

I've actually devised a couple of solutions, and will be presenting one as an answer using `reduce` below (I've also used `forEach` in other attempts but will not be presenting that). I guess it could also be done by first filtering, then (custom) sorting, but that would seem to iterate twice. Maybe another alternative is to use a method (or methods) from `lodash`, though I'm not sure what that would be.