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

Tell us what’s happening:

Sorry, your code does not pass. Don’t give up.

Your sortSongs function should use arrow function syntax.

Your code so far

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

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

const sortSongs = (songs) => songs.sort((a, b) => a.title.localeCompare(b.title));


// User Editable Region
/* file: styles.css */

Your browser information:

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

Challenge Information:

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

Hi there!

The instructions didn’t asked to add sort() method on songs.
Instructions is asking you : Start by creating an arrow function called sortSongs. Just create an empty arrow function sortSongs

1 Like