You have made small mistakes, and once you find them you’ll think “Why didn’t I see it sooner!”
Read your code again,
Are all the conditions (==) right?
Do you return the exact right thing for each of your else if?
Initially I struggled understanding the concept of the the problem but after several research and experiments I solved it with a different approach using the “names” array and the built in length function. Since the length function returns the number of items in an array I subtracted the length (which is 7) by 7 to get the index number which corresponds to the lowest priority in the array inside the array operator (square brackets) and decreased the number by 1 for each and ever else if statement to get the right index.