Still not figuring it out

Step 31

Inside the playSong function, set the audio.src property equal to song.src. This tells the audio element where to find the audio data for the selected song.

Also, set the audio.title property equal to song.title. This tells the audio element what to display as the title of the song.

const playSong = (id) => {
  const song = userData?.songs.find((song) => song.id === id);
  if (song) {
    audio.src = song.src;
  }
};

and it still dont work

It’s helpful if you can include a link to the step which you’re stuck on.
I’ve edited your post accordingly.

You’ve completed one of the steps for this challenge, but not the other.

Also, set the audio.title property equal to song.title .

const playSong = (id) => {
  const song = userData?.songs.find((song) => song.id === id);
  if (song) {
    audio.src = song.src;
    audio.title = song.title;
  }
};
1 Like

im not sure how to provide a link im still a noob
i also don’t understand why code camp would suggest javascript after html css
kinda feel thrown under a bus lol

Yeah, that sounds about right when you’re starting out on Javascript. It gets easier and a lot more fun though imho.

If you’re stuck on a challenge, there’s a forum template which is created automatically when you click on the Help icon (which appears after you have submitted incorrect code three times).

This will create a forum post which includes your full code, a direct link to the challenge and an opportunity for you to describe your issue.

i reposted it but im sure you guys are getting annoyed trying to help me with one challenge

Sorry, I hadn’t noticed that you’d put it inside an if statement. Why did you do that?
Remove that if statement and the code you posted above should pass.

thank you very much i appreciate your straightforward response

1 Like

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