142
rated 0 times
[
149]
[
7]
/ answers: 1 / hits: 8184
/ 11 Years ago, thu, february 20, 2014, 12:00:00
I have this function
notes.forEach(function(note) {
setTimeout(function() {
playNote(note);
}, 1000);
});
This doesn't work. It plays all the notes at the same time, instead of playing them sequentially with a 1 second gap in between. It looks like I need to have a closure here to make this work. Could someone help me fix this function so it would play the note with the delay between each note?
More From » closures