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

Tell us what’s happening:

provide a solution to this task To finally play the song, use the play() method on the audio variable. play() is a method from the web audio API for playing an mp3 file.

Your code so far

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

/* file: styles.css */

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

const audio = new Audio(play());
playButton.classList.add("playing");

// 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/125.0.0.0 Safari/537.36 Edg/125.0.0.0

Challenge Information:

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

hello and welcome to fcc forum :slight_smile:

  • wrong syntax
  • use “play()” on “Audio” instance instead in next line

happy coding :slight_smile: