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 callrenderSongs and pass the argument.