Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
  <meta charset="utf-8">
  <title>JS Bin</title>
</head>
<body>
</body>
</html>
 
function print(text) {
  document.body.innerHTML += text + "<br>";
}
function foo1() { print("foo1() called"); }
function foo2() { print("foo2() called"); }
function foo3() { print("foo3() called"); }
function foo4() { print("foo4() called"); }
function foo5() { print("foo5() called"); }
setTimeout(function(){
    setInterval(function() {
      foo1();
    }, 5000);
}, 1000);
setTimeout(function(){
    setInterval(function() {
      foo2();
    }, 5000);
}, 2000);
setTimeout(function(){
    setInterval(function() {
      foo3();
    }, 5000);
}, 3000);
setTimeout(function(){
    setInterval(function() {
      foo4();
    }, 5000);
}, 4000);
setTimeout(function(){
    setInterval(function() {
      foo5();
    }, 5000);
}, 5000);
Output

This bin was created anonymously and its free preview time has expired (learn why). — Get a free unrestricted account

Dismiss x
public
Bin info
anonymouspro
0viewers