Step 26 build a music player not passingBuild a Music Player - Step 26

hi. totally blind, using jaws 2025 on windows 11 pro. using google chrome. now on step 26 and stuck, i will paste the minimal code below and also the error message. it is not passing and have researched the code via google. now it is not passing and checking the if the current or next song is empty. then checks if it is empty or not, if empty, then goes back to the list on the array, plays the current song or plays the song in the que which is present. so pasting the error message, my code and the link to the step below. can any one help me out? frustrated. and cannot see. so not sure if any hidden characters or hidden spacing. i have reset and refreshed the page, and so is it my code or the fcc having a bug or just being very picky. tearing my hair out and tried about 30 or more times to then modify my code, testing, looking up on google. so still not passing, and spent the past couple of hours to get this to work, i am in australia. any mods here from australia who can help me out or from new zealand or asia. or have to wait till tomorrow for a reply.

thank you for your value time.

marvin hunkin.

ps: pasting the code, the erro message and the link below.

minimal java script code:

let userData = {
songs: \[
{ id: 0, title: “Song 1”, src: “url1.mp3” },
{ id: 1, title: “Song 2”, src: “url2.mp3” }
\],
currentSong: null,
};

function playSong(id) {
console.log(“Playing song with id:”, id);
userData.currentSong = userData.songs.find(song => song.id === id);
}

function playNextSong() {
// FCC test: if no song is playing, start the first song
if (userData.currentSong === null) {
playSong(userData.songs\[0\].id);
return;
}

// Otherwise, play the next song in the list
const currentIndex = userData.songs.findIndex(
song => song.id === userData.currentSong.id
);
const nextSong = userData.songs\[currentIndex + 1\];
if (nextSong) {
playSong(nextSong.id);
}
}

// Example usage to show it fails the test
playNextSong(); // Should play song with id 0

error messages:

When the currentSong of userData is strictly equal to null, your playNextSong function should call the playSong function with the id of the first song in the userData.songs array as an argument.


Reset

  1. When the currentSong of userData is strictly equal to null, your playNextSong function should call the playSong function with the id of the first song in the userData.songs array as an argument.
    // tests completed
    links to the step 26 of the project:
    https://www.freecodecamp.org/learn/full-stack-developer/workshop-music-player/step-26

You have again made changes that the Step did not request. You need to start with the code the Step gives you.

hi, can some one else apart from jeremy or others. got a rejection for help. feels like i am being rejected. okay theres a bug with the fcc for step 26 for the music player project. and i have reset the lesson, did hard refreshes, and googled and researched. but it is not passing and have tried multiple rewrites of the function, so is it my code, or a bug on fcc end. and will not pass it. as totally lbind and relying on a screen reader, more accessibility barriers. i have researched the errors and so if some one can help me out. why it is not passing, and dont judge me, have got the code what the fcc is looking for. just totally frustrated and fed up, spent most of the day trying to get this one step to pass, but facing accessibility barriers and frustration. so pasting the function code below. the errors and the link to the step. if some one can help me out, and try using your computer with your eyes closed and relying on speech.

marvin.

ps: pasting below.

minimal javascript:

function playNextSong() {
if (userData.currentSong === null) {
playSong(userData.songs\[0\].id);
return;
}
const nextSong = userData.songs\[getCurrentSongIndex() + 1\];
if (nextSong) playSong(nextSong.id);
}

errors:

When the currentSong of userData is strictly equal to null, your playNextSong function should call the playSong function with the id of the first song in the userData.songs array as an argument.

link to the step:

thank you.

marvin hunkin.

.

the tests are confused because there is extra code than what is expected, you are asked only to do something when userData.currentSong is strictly equal to null, but your function also does something else. Remove the extra code to pass.

I’m not judging you. But you will keep having this exact same issue if you do not use the starting code for every Step. I’m not sure why you absolutely do not want to use the starting code given to you for each step and don’t want to only make changes from the current step and not future steps. If you do not want to use the starting code from the Step, then you are better off just ignoring the tests and doing your own thing. Mixing together changes from the future steps will absolutely also confuse the tests. Just ignoring these problems and continuing to ask for help when you keep changing more code than the tests want you to change makes it very difficult for people to help you.