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

Tell us what’s happening:

I genuinely don’t know what I’m doing wrong here.
Instructions are:

Inside the map() , add a return statement with backticks where you will interpolate all the elements responsible to displaying the song details.

Inside the backticks, create an “li” element with an “id” attribute of song-${song.id} and a “class” attribute of “playlist-song”.

Here’s what I wrote:

return <li id="song-${song.id}" class="playlist-song">;//for some reason the backticks are missing from the post but I did include them in my code.//

It tells me that my:

(1) code does not pass, and
(2) opening “li” tag should have an id attribute set to “song-${song.id}”

I cannot figure out what I’m doing wrong.

Your code so far

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

/* file: styles.css */

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

return `<li id="song-${song.id}" class="playlist-song">`;

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

Challenge Information:

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

All that’s missing is a closing li tag.

1 Like

solution redacted by moderator

hey @tucecifci

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.

my solution is not working, ı am stuck

hey @tucecifci

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 Ask for Help button located on the challenge (it looks like a question mark). This button only appears if you have tried to submit an answer at least three times.

The Ask for 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.