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
- 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