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

really dont unserdstand, i also tried var

const playSong = (id) => {
const song = userData?.songs.find((song) => song.id === id);
const audio = document.getElementById(“audio”);
const title = document.getElementById(“title”);
};

is there a place where i can read up on java and gain a better understanding so i no longer need to bother everyone lol :slight_smile:

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 (X11; Ubuntu; Linux x86_64; rv:123.0) Gecko/20100101 Firefox/123.0

Challenge Information:

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

Welcome to the forum @chrsdplsss

Here is the hint from the console.log
image

On the top right of every forum page there is a magnifying glass icon which you can select and search topics and posts.

There is also the news page.

Happy coding

///ive tried this
const playSong = (id) => {
const song = userData?.songs.find((song) => song.id === id);
const userData?.songs.audio.src = (song.src);
const userData?.songs.audio.title = (song.title);
};

/// ive tried this
const playSong = (id) => {
const song = userData?.songs.find((song) => song.id === id);
const audio.src = userData?.songs.(song.src);
const audio.title = userData?.songs.(song.title);
};

///ive tried this
const playSong = (id) => {
const song = userData?.songs.find((song) => song.id === id);
const audio = document.getElementById(“audio”);
const title = document.getElementById(“title”);
};
/// this

const playSong = (id) => {

const song = userData?.songs.find((song) => song.id === id);

const audio = document.getElementById(id);

const title = document.getElementById(id);

};

/// ive tried many variations looked at the javascript sections of ws, mdn, code academy free code camp etc etc…ive looked threw the forum for help, and seems like ever step 31 for this music player is a completely different tasks i cant seem to figure it out pls help

const playSong = (id) => {
const song = userData?.songs.find((song) => song.id === id);
if (song) {
audio.src = song.src;
audio.title = song.title; // Set the title property
audio.play();
}
};

/////STILL STUCK???//////

Hi @chrsdplsss

Reset the step, then just assign the variable to the value mentioned in the console log, without adding or changing anything else.

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