Build a Music Player - Step 35

Tell us what’s happening:

I’m rather confused. The test error message says “You should add an if statement that checks if userData.currentSong === null and stops the function execution with a return statement inside your playPreviousSong function.” From my understanding that’s exactly what I am doing. Is there a spelling error or something I’m misunderstanding/overlooking?

Your code so far

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

/* file: styles.css */

/* file: script.js */
// User Editable Region
  if(userData.currentSong === null){
    return;
  }
// User Editable Region

Your browser information:

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

Challenge Information:

Build a Music Player - Step 35

GitHub Link: freeCodeCamp/curriculum/challenges/english/blocks/workshop-music-player/675340b809683f45cae96539.md at main · freeCodeCamp/freeCodeCamp · GitHub

try writing it without the {}

Thank you, that worked! Is there any reason why it wouldn’t work without? Is it just a specific requirement of the test?

it was a development oversight, the test was recently updated (but it is not yet deployed) to accept both versions