Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width">
  <title>JS Bin</title>
</head>
<body>
</body>
</html>
 
function f(n) {
  setTimeout(function(){
    console.log(n)
  }, 1000*n);
}
function sleepSort() {
  for(var i=0;i < arguments.length; i++) {
    arg = arguments[i];
    f(arg);
  }
}
sleepSort(5,2,6,7,3,4);
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x