What is going on in my code? i check if currenttitle is true, then assign playingsongtextcontent to current title and if not i set it to “”, for me seens like i dont have where to store it or misstore it somewhere?
Your code so far
<!-- file: index.html -->
/* file: styles.css */
/* file: script.js */
// User Editable Region
currentTitle ? playingSong.textContent = currentTitle : playingSong.textContent = "";
currentArtist ? songArtist.textContent = currentArtist : 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/128.0.0.0 Safari/537.36 OPR/114.0.0.0
Challenge Information:
Learn Basic String and Array Methods by Building a Music Player - Step 70
currentTitle and currentArtist should be use as the ternary condition. Variables playing song and songArtist should be used with the .textContent at beginning.
playingSong.textContent = currentTitle ? currentTitle : “”;?
So i should say what will be with smth if , then condition, and true or false then?
So in this case smth will be textcontent of playing song then condition of currenttitle and if yes then it is as it is and if not then “”