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

Tell us what’s happening:

I dont understand it pls help

Your code so far

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

/* file: styles.css */

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

  currentTitle = currentTitle ? playingSong.textContent(currentTitle)  : "";
  currentArtist = currentArtist ? songArtist.textContent(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/128.0.0.0 Safari/537.36

Challenge Information:

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

hi there!

.textContent is not a funtion. also it is goes to the right side of asignment = opretor with element/variable name.

Mod edit code removed

you mean something like thus

what happened when you tried?
please don’t share solution code here unless you need help.

I used that solution but it shows me an error in the point of both variables

If you have a question about a specific challenge as it relates to your written code for that challenge and need some help, click the Help button located on the challenge. This button only appears if you have tried to submit an answer at least three times.

The Help button will create a new topic with all code you have written and include a link to the challenge also. You will still be able to ask any questions in the post before submitting it to the forum.

Thank you.

1 Like

Hello :slight_smile:

It is all about how the Ternary operator works.

The Ternary operator is ? :
and it RETURNS a value.

The Ternary is used like this
condition ? return_value_if_condition_is_true : return_value_if_condition_is_false;
Now, check the example code in the task 70, and you will observe that the return value of the Ternary operator was assigned to a variable like this
const variable = condition ? return_value_if_condition_is_true : return_value_if_condition_is_false;

In these examples, the variable(s) were declared, and the return value(s) were assigned to them on the same line of code. However in the task you are given, the variables you expected to use were declared earlier on. So, you just have to assign the return values to them.

This the concept you are expected to apply in your solution.

Cheers! Happy Coding :slight_smile: