Hello, I’ve been struggling with this one for a while. Here is my code:
The instructions are asking to set the values of currentTitle and currentArtist if they are truthy. I’ve set currentTitle/currentArtist equal to the results of the ternary operator,but receive an error/tip that says:
" You should use the ternary operator to set the textContent property of playingSong to currentTitle or "" . " Any help would be appreciated.
Your code so far
/* file: script.js */
// User Editable Region
currentTitle = currentTitle ? playingSong.textContent : "";
currentArtist = currentArtist ? 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/125.0.0.0 Safari/537.36
Challenge Information:
Learn Basic String and Array Methods by Building a Music Player - Step 70
This might be worded a bit strange, but what’s needed is modifying the playingSong.textContent and songArtist.textContent, with whatever will be returned in the ternary operation.