Created
February 15, 2016 13:45
-
-
Save htmelvis/ef44d47b1f8635983fcc to your computer and use it in GitHub Desktop.
Timed Iteration in JavaScript
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function() { | |
var i = 0, | |
adArray = [13,14,15,16,17,18,19,110,111,112,113,114,115,116], | |
l = adArray.length; | |
(function iterator() { | |
console.log('Loop: ', i, ' Loop content: ', adArray[i]); | |
//update before evaluating the conditional | |
if (++i < l) { | |
setTimeout(iterator, 1500); | |
} | |
})(); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment