I have an array with objects that have the following format:
{
"username": "Antonio",
"bot": false
}
I currently have the following code:
guild.members.sort((a, b) => a.user.username > b.user.username ? 1 : -1);
In which, sort the array in alphabetical order, however, I want users whose property bot
is true
to come first, in alphabetical order.