Tell us what’s happening:
I check below code output by ‘console.log’ and it show me correct title of current song. but I can’t find right solution to pass this step.
userData.songs[getCurrentSongIndex()].title
Your code so far
/* file: script.js */
// User Editable Region
function setPlayerDisplay() {
if (userData.songs[getCurrentSongIndex()].title) {
playinSong.textContent = userData.songs[getCurrentSongIndex()].title;
}
else {
playinSong.textContent = "";
};
if (userData.songs[getCurrentSongIndex()].artist) {
songArtist.textContent = userData.songs[getCurrentSongIndex()].artist;
}
else {
songArtist.textContent = "";
};
}
// User Editable Region
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36
Challenge Information:
Build a Music Player - Step 41
https://www.freecodecamp.org/learn/full-stack-developer/workshop-music-player/step-41