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

Tell us what’s happening:

Could anyone please tell me what I’m doing wrong because I added ?. this to both calls at first I thought it was a method until I tried calling it like a function but it also did not work as well.

Your code so far

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

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

userData?.songs.renderSongs()

// 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 26

1.Make sure userData is properly defined and initialized before calling userData?.songs.renderSongs()
2. Confirm that userData.songs has a renderSongs method.
3. Happy Codding!

extra help :

  • Check if songs exists.
  • Verify if renderSongs is a function.
  • If both conditions pass, then call renderSongs and pass the argument.
1 Like

@AlexK it’s great you want to help, but you should familiarize yourself with the curriculum first

1 Like

Now you need to call the renderSongs function and pass in userData?.songs in order to finally display the songs in the UI.

You created renderSongs earlier, so now you need to call it, do you remember how you call a function and pass it an argument?