Tell us what’s happening:
I’m not passing the test. I tried to extract n using match and the replace methods. Both don’t work. I have no idea what i’m dooing wrong. Please Help. Thanks in advance
Your code so far
<!-- file: index.html -->
/* file: styles.css */
/* file: script.js */
// User Editable Region
songs.forEach((song) => {
song.addEventListener("click", () => {
const id = song.id;
const n = Number(id.replace("song-", ""));
playSong(n);
});
});
// User Editable Region
Your browser information:
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36
Challenge Information:
Build a Music Player - Step 20