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

Tell us what’s happening:

not accepting right answers .
tried to solve it but

Your code so far

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

/* file: styles.css */

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

 const song = userData.currentSong;

// User Editable Region

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36

Challenge Information:

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

This is not correct, and the challenge is correctly rejecting this code.


The song variable is already declared and cannot be re-declared.

You need to use the song variable that’s already there and assign its value to the userData.currentSong. (or to say it another way, your use of = is “backwards”)

Start by accessing the userData object and its currentSong property. Set its value equal to the song variable.

I might say it like this instead.

Assign song to the currentSong property on the userData object

Seems a lot more straight forward


Accessing a property implies reading, more than writing. Sure, you are then told to “set its value” but the sentence is harder to read than it has to be.

3 Likes

created an issue here

I made a PR, sorry I should have said so. I will link to your issue.

1 Like

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