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

Tell us what’s happening:

I know what code to use to pass this however I’ve not seen anywhere why this does not pass.

Looking at the results its the same as what I got when completing this step.

I am more curious why this result that equals the same fails. Would this have a negative impact within a different code or in the future?

What I had that failed was this.

renderSongs(sortSongs(userData?.songs));

Thank you for taking the time to read/answer my question.

Your code so far

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

/* file: styles.css */

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

renderSongs(sortSongs(userData?.songs));

// 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/138.0.0.0 Safari/537.36

Challenge Information:

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

Welcome to the forum @toothpick164

Change your renderSongs function to call the sortSongs function.

The sortSongs function accesses userData?.songs, so it does not need an argument.

Happy coding

Thank you,
So due to it already calling the userData? within the sortSongs function I would be double handing myself by having it in this situation. Otherwise it works just no need to have that argument within the call.
Ive changed and passed it, appreciate you taking the time.

1 Like