How do i make a leaderboard for levels?

Hello, so i recently found and online tutorial on how to make a leveling system, which can be found here:

However, i was unable to figure out how to create the leaderboard, since (.startsWith) doesn’t exist anymore. Any help would be nice, thanks in advance.

Hi, welcome!

It sounds like you’re looking for an alternative for startsWith for a text string in JavaScript, is that right?

From the docs, it looks like startsWith is still a thing, but there are alternatives like checking the first few letters with substring.

Can you post the particular bit of code you’re trying to get working?

Cheers! :slight_smile:

1 Like

I’ve posted the link to the code im using. And as far as i researched, startsWith doesn’t exist anymore in version 7.1.1 of quick.db, I’ve seen others recommend to use db.all then array.sort. However, I don’t want it to grab the entire db and only the Levels from the leveling system. and i also don’t know how to use the array.sort command. The entire code works fine, I just want to know how to grab the user’s levels, sort them and display them on an embed as a leaderboard.