Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

for loop set timeout

for(var i = 1; i < 6; i++) {
  setTimeout(function() {
     console.log(i);
  },1000);
}
console.log('The loop is done!');
Source by www.freecodecamp.org #
 
PREVIOUS NEXT
Tagged: #loop #set #timeout
ADD COMMENT
Topic
Name
5+2 =