Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>JS Bin</title>
</head>
<body>
</body>
</html>
 
var guid = 0;
function run() {
  guid++;
  var id = guid;
  return new Promise(resolve => {
    setTimeout(function () {
      console.log(id);
      resolve(id);
    }, (Math.random() * 1.5 | 0) * 1000);
  });
}
var promises = Array.from({ length: 10 }, run);
Promise.all(promises).then(console.log);
Output 300px

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

Dismiss x
public
Bin info
rempro
0viewers