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

Tell us what’s happening:

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 see if the thread linked below will help

1 Like

i was asked to check maybe currentTitle is truthy

i have tried this it is not working

What have you tried since reading the above?

i tried this code
currentTitle?playingSong.textContent=currentTitle:playingSong.textContent=" ";

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.

i was not given any instrution to assign to a variable

When you read the step it says: “… set playingSong.textContent to …”

So the word “set” here means assign playing song.textContent to something.

The something is the result of the ternary.

1 Like

Mod edit: solution removed
is it something like this

thanks man i appreciate

1 Like

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.