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

Tell us what’s happening:

Here is my code but it seems I’m missing something…
The test kepp failling with the message
// running tests 2. You should use the ternary operator to set the textContent property of playingSong to currentTitle or “”.
4. You should use the ternary operator to set the textContent property of songArtist to currentArtist or “”.
5. // tests completed

Your code so far

`currentTitle ? playingSong.textContent = currentTitle : currentTitle = “”;

currentArtist ? songArtist.textContent = currentArtist : currentArtist = “”;`

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

/* file: styles.css */

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

  const currentTitle = currentTitle ? playingSong.textContent = currentTitle : currentTitle = "";

  const currentArtist = currentArtist ? songArtist.textContent  = currentArtist : currentArtist = "";

// 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/129.0.0.0 Safari/537.36

Challenge Information:

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

right now you have currentTitle on the left of the equal sign (and currentArtist).
This is incorrect.

You also have 2 equal signs on the same line. That is also incorrect.

You should have exactly one equal sign and the variable on the left is the one that is being updated. If you read the instructions again, what do they say is the variable(s) that should be updated?

1 Like

Thanks I found the way through.

1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.