Answers for "javascript async script"

14

async javascript

(async () => {
  let response = await fetch('/article/promise-chaining/user.json');
  let user = await response.json();
  ...
})();
Posted by: Guest on July-31-2021
6

javascript async script

<script async src="script.js"></script>
Posted by: Guest on July-09-2020
4

async await javascript

function hello() {
  return new Promise((resolve,reject) => {
    setTimeout(() => {
      resolve('I am adam.');
    }, 2000);
  });
}
async function async_msg() {
  try {
    let msg = await hello();
    console.log(msg);
  }
  catch(e) {
    console.log('Error!', e);
  }
}
async_msg(); //output - I am adam.
Posted by: Guest on November-18-2020
2

script async syntax

<script src="demo_async.js" async></script>
Posted by: Guest on June-25-2020
-1

script deferred

<script src="demo_defer.js" defer></script>
Posted by: Guest on June-25-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language