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>
 
async function fn1() {
  try {
    return 'ok';
  } catch(e) {
    return 'fail';
  }
}
async function fn2() {
  let result = false;
  
  try {
    result = true;
  } catch(e) {
    result = false;
  }
  
  return result;
}
async function fn3() {
  let result = false;
  
  try {
    throw 'error';
  } catch(e) {
    result = false;
  }
  
  return result;
}
(async () => {
  let a = await fn1();
  let b = await fn2();
  let c = await fn3();
  
  console.log(`fn1:${a}`);
  console.log(`fn2:${b}`);
  console.log(`fn3:${c}`);
  
})();
Output

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

Dismiss x
public
Bin info
anonymouspro
0viewers