Learn Basic String and Array Methods by Building a Music Player - Step 29

Tell us what’s happening:

const sortSongs = () => {

allSongs.sort((a, b) => {});

};

hi, My code doesn’t pass.
You should have an empty callback function ()=>{} inside your sort() method with a and b for the parameter names.

“I followed the method explained by the exercise, yet it still doesn’t pass. I can’t find the error. Can anyone help me?”

Your code so far

<!-- file: index.html -->

/* file: styles.css */

/* file: script.js */
// User Editable Region

const sortSongs = () => {
 
allSongs.sort((a, b) => {});

};



// User Editable Region

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36

Challenge Information:

Learn Basic String and Array Methods by Building a Music Player - Step 29

1 Like

You deleted a portion of your code, reset the lesson to regain it and add a callback function with a and b as the parameters to your sort method.

1 Like