Learn Basic String and Array Methods by Building a Music Player - Step 70

Tell us what’s happening:

I tried to make ternary operator but keep saying you should use ternary operator I also check using chatgpt and its says its perfect still I can not go pass this step

Your code so far

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

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

  
playingSong.textContent = (currentTitle) ? currentTitle : "";
songArtist.textContent = (currentArtist) ? currentArtist : "";




// User Editable Region
/* file: styles.css */

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Safari/537.36 OPR/117.0.0.0

Challenge Information:

Learn Basic String and Array Methods by Building a Music Player - Step 70

The code looks fine, try removing the condition’s brackets?

1 Like

please remember that ChatGPT doesn’t know how to code, it only generates text that is statistically likely

you may need to remove the parentheses from inside the ternary, they are not needed

1 Like

Oh, okay, I just took a reference because I was stuck in that. Thanks!!

Yeah it works Thanks