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, minimum-scale=1.0">
  <title>JS Bin</title>
</head>
<body>
</body>
</html>
 
function wait(ms) {
  return new Promise(r => setTimeout(r, ms));
}
const a = wait(500);
const b = a.then(() => wait(1000));
a.then(() => {
  console.log('a resolved');
});
b.then(() => {
  console.log('b resolved');
});
Output 300px

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

Dismiss x
public
Bin info
jakearchibaldpro
0viewers