AsyncAwait

Any function with the async flag will return a promise.

Any function call with await will wait until the promise is resolved.

To avoid using try catch

  1. async function iCallAPromise() {
  2. const result = await fetchUsers().catch(error => error);
  3. console.log(result);
  4. }