Check out my code snippet below:
var song = ['note1.mp3', 'note2.mp3', 'note3.mp3', 'note4.mp3']
for(i = 0; i < song.length; i++) {
setInterval(function() {
//play song[i]
//or console.log(song[i]);
}, 1000);
}
I'm running into issues with this implementation. Can anyone provide insight as to why it's not working? My goal is to play note1.mp3, followed by note2, note3, and finally note4.
Any help would be greatly appreciated. Thank you!