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

Tell us what’s happening: It says to call the playsong() function so I tried with the () but told me invalid left hand assignment. Would I need an const or let ?

Your code so far

Within the arrow function of the event listener, add an if to check if userData?.currentSong is null.

Inside the if block, call the playSong() function with the id of the first song in the userData.songs array. This will ensure the first song in the playlist is played first.

if (userData?.currentSong === null) {
playSong = userData?.songs[0].id



The challenge seed code and/or your solution exceeded the maximum length we can port over from the challenge.

You will need to take an additional step here so the code you wrote presents in an easy to read format.

Please copy/paste all the editor code showing in the challenge from where you just linked.

Replace these two sentences with your copied code.
Please leave the ``` line above and the ``` line below,
because they allow your code to properly format in the post.

Your browser information:

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

Challenge Information:

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

Hi. You are trying to assign something to a function. You can only assign stuff to variables and similar.
Calling a function with something means passing an argument into a function.
For example like this: myCoolFunction(argument).


This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.