I wanted to know how I can return an array of names currently on the leaderboard.
This is the code I have:
You can fetch the li values into an array with this line of code:
return Array.from(document.querySelectorAll('#top10>li'), li => li.textContent)
If the intention is to limit that result array to maximumResults elements, then you can use slice:
return Array.from(document.querySelectorAll('#top10>li'), li => li.textContent)
.slice(0, maximumResults)