Imagine we have array like this:
const words = ['luigi', 'Bar', 'Test', 'zac1', 'Alf0'];
Now I would like to sort this array alphabetically:
words.sort((a, b) => a.localeCompare(b));
Imagine we have array of super words. This words have high priority and should be on the top of 'words list'.
const superWords = ["zac1", "Test"]
So the desired result of words array will be:
const desiredResult = ["Test", "zac1","Alf0", "Bar", "luigi"]
How can I do it?