Build a Music Player - Step 41

Tell us what’s happening:

Not sure why this doesn’t work- is it the conditions, or what’s actually in the if statements?

Your code so far

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

/* file: styles.css */

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

function setPlayerDisplay() {
  if (userData.currentSong.title) {
    playingSong.textContent = userData.currentSong.title;
  } else {
    playingSong.textContent = "";
  };
  if (userData.currentSong.songArtist) {
    songArtist.textContent = userData.currentSong.songArtist;
  } else {
    songArtist.textContent = "";
  };
}

// User Editable Region

Your browser information:

User Agent is: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36

Challenge Information:

Build a Music Player - Step 41

Worked it out now, thanks.

1 Like