Medium

JavaScript Array Sort Not Working: How to Correctly Sort Objects by Priority Value

Santa needs to sort the list of presents based on their priority. However, there's a slight issue with how the gifts are being ordered. What’s wrong with this code?

Choose an option below