i used the tenary operator to check maybe current title is true or false and when true i assigned playingSong.textContent to currentTitle and if it is false playingSong.textContent = " ";
i did the same for currentArtist
Your code so far
<!-- file: index.html -->
/* file: styles.css */
/* file: script.js */
// User Editable Region
currentTitle?playingSong.textContent=`${currentTitle}` :playingSong.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/126.0.0.0 Safari/537.36
Challenge Information:
Learn Basic String and Array Methods by Building a Music Player - Step 70
Please read the post above again. The pattern starts with:
variableName =
Try to figure out which variable should be written in place of variableName then write an equal sign. After that write the ternary statement on the right side of the equal.
It is great that you solved the challenge, but instead of posting your full working solution, it is best to stay focused on answering the original poster’s question(s) and help guide them with hints and suggestions to solve their own issues with the challenge.
We are trying to cut back on the number of spoiler solutions found on the forum and instead focus on helping other campers with their questions and definitely not posting full working solutions.