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

Tell us what’s happening:

Your code so far

WARNING

The challenge seed code and/or your solution exceeded the maximum length we can port over from the challenge.

You will need to take an additional step here so the code you wrote presents in an easy to read format.

Please copy/paste all the editor code showing in the challenge from where you just linked.

Replace these two sentences with your copied code.
Please leave the ``` line above and the ``` line below,
because they allow your code to properly format in the post.

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 YaBrowser/24.1.0.0 Safari/537.36

Challenge Information:

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

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

The code doesn’t work and I don’t understand what is written in the identifier in the class, what complexity is written, where does it come from and what do they do?

your id is missing a quote

return <li id="song-${song.id}" class="playlist-song"></li>
the code worked but questions remained))) what kind of entry is this in the ID?

that is a template literal, which is what is being taught from a few steps ago

I got it, I don’t understand what song-${song.id} is

a template literal, you get the value of song.id interpolated in the string

or do you mean where the value comes from?

Where does it come from? I’ve never seen anything like this in ID, so I don’t understand this entry.

renderSongs has not been called yet, but I guess it would have allSongs as an argument
renderSongs(allSongs)

that means that to the callback of map you would get each of the objects in allSongs

notice that you are building the html as a string, it’s not HTML code yet, you will need to tell the engine to use that string as html code somewhere

[quote=“ilenia, post:7, topic:670883, full:true”]
или вы имеете в виду, откуда берется значение?
[/quot
yes, it’s not clear to me

This is all already confusing at the initial stage, although I am not a beginner, I no longer understand these complex records, then the question is different, do you have another program that explains in detail the operation of such tasks? Since no beginner will understand this

there is the legacy javascript curriculum, if you want to try something different, but coding is complex

for example, everyone understands what an entry in the playlist-song class is, this is clear, but what it is in the song-${song.id} identifier is a big mystery)))

Note - sticking with something while frustrated is a key skill in learning any programming. You need the ability to stick with a task

the value of song.id is dinamically replaced to have a different id for each song

ok, it’s impossible to understand, all I have to do is agree))

1 Like

It’s definitely possible to understand. People have been completing these steps. It’s not always easy to learn programming though.

Yes, it’s not easy, I haven’t met smart people who showed a good project in javascript, since this is not an understandable language, personally, I’m here to see how it’s written, I, of course, have never seen such posts in order to understand these tasks and where they cannot be taken here, it is necessary to carefully think through and clarify the tasks so that the chain of a function or variable is visible, step by step with arrows, so that everything is visible and traceable.

I’m not sure what you mean, but there plenty of people in the world who understand JavaScript. If you have specific suggestions for our courses, please let us know, but saying that JavaScript is impossible isn’t really true or helpful.

Only a beginner will be able to help you improve your site, since only he will be able to see your mistakes, for example, when you hover over an element, you can make a pop-up window that would show where it came from.
Besides, the instructions here are a sore subject; they need to be explained with a few examples.