The help prompt says to call the playSong function with userData?.song[0].id inside your if block.
This is what I thought I did. I tried return along with it too to no avail. Where did I go wrong?
Your code so far
<!-- file: index.html -->
/* file: script.js */
// User Editable Region
if (userData?.currentSong === null) {
playsong(userData?.songs[0].id)
}
// User Editable Region
/* file: styles.css */
Your browser information:
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.0 Safari/605.1.15
Challenge Information:
Learn Basic String and Array Methods by Building a Music Player - Step 43
The lesson did accept the use of null in the beginning of the statement once I fixed my capitalization error. Should null not be used irl to check if something is falsey?
Yes I am aware that the lesson is accepting this but to check if something is a falsey you should be checking for more than null values. For eg a zero is a falsey. So is an empty string. So is undefined.