Skip to content

Instantly share code, notes, and snippets.

@zgulde
Created April 7, 2016 21:09
Show Gist options
  • Select an option

  • Save zgulde/1e5bb7bd67d11437a99c7464006a6801 to your computer and use it in GitHub Desktop.

Select an option

Save zgulde/1e5bb7bd67d11437a99c7464006a6801 to your computer and use it in GitHub Desktop.
var myArray = [1, 2, 3, 4];
var i = 0;
var intervalId = setInterval(function(){
console.log(myArray[i]);
i++;
if (i == myArray.length) {
clearInterval(intervalId);
}
},1000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment