I'm trying to sort an array of strings based on an array of objects. (The array will not have the same amount of items the object has.)
Here's the code:
const myObject = [
{
title: 'Some string'
},
{
title: 'another string'
},
{
title: 'Cool one'
}
];
const array = ['Cool one', 'Some string']; // Sort this array based on 'myObject'