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

Tell us what’s happening:

I need to create a song constant and use the OR operator (||) to set it to the current song of userData or the first song in the userData.songs array.

I dont think this is right becausde the ‘=’ is declaring he variable const but I am not sure what else to try.

const song = userData.currentSong || userData?.songs?.[0];

Your code so far

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

/* file: styles.css */

/* file: script.js */
// User Editable Region

const setPlayButtonAccessibleText = () => {
const song = userData.currentSong || userData?.songs?.[0];
};

// 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/126.0.0.0 Safari/537.36

Challenge Information:

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

You have missed a ? at the end of the first “userData”. You should not have a full stop before the [0].