Answers for "js settimeout countdown"

150

javascript settimeout

setTimeout(function(){
 	alert("Sup!"); 
}, 2000);//wait 2 seconds
Posted by: Guest on June-27-2019
1

settimeout in a for loop javascript

// make sure to use "let" and not "var" if you want to capture
// the value of the external variable in a closure

  for (let i = 0; i < 5; i++) {
    setTimeout(() => console.log(i), 0);
  }
Posted by: Guest on February-20-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language