Skip to content

Instantly share code, notes, and snippets.

@ofirdagan
Created October 3, 2017 15:33
Show Gist options
  • Save ofirdagan/9ad5de348a0c18e8ab9002d264febdf5 to your computer and use it in GitHub Desktop.
Save ofirdagan/9ad5de348a0c18e8ab9002d264febdf5 to your computer and use it in GitHub Desktop.
What will that print? - async
(async function wrapper() {
const foo = async () => {
return true;
};
const goo = async () => {
return Promise.resolve(true);
};
const x = foo();
console.log(`x: ${x}`);
const y = await foo();
console.log(`y: ${y}`);
const x2 = goo();
console.log(`x2: ${x2}`);
const y2 = await goo();
console.log(`y2: ${y2}`);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment