Skip welcome & menu and move to editor
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>
 
const promise1 = randomPromise(1);
const promise2 = randomPromise(2);
const promise3 = randomPromise(3);
Promise.all([promise1, promise2, promise3]).then(function(values) {
  console.log(values);
});
function randomPromise(id) {
  // Each promise can take upto 5 seconds to execute
  const delay = Math.random() * (5000 - 100) + 100;
  return new Promise(resolve =>
    setTimeout(() => {
      console.log(id);
      resolve([id, delay]);
    }, delay)
  );
}
Output 300px

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

Dismiss x
public
Bin info
anonymouspro
0viewers