Skip to content

Instantly share code, notes, and snippets.

@juanpicado
Created September 23, 2016 18:16
Show Gist options
  • Save juanpicado/88bf222a4286325f06e92887b406b090 to your computer and use it in GitHub Desktop.
Save juanpicado/88bf222a4286325f06e92887b406b090 to your computer and use it in GitHub Desktop.
async function example
const myPromise = (a) => {
return Promise.resolve(a);
}
async function foo() {
let d1 = await myPromise(1).then(console.log);
let d2 = await myPromise(2).then(console.log);;
}
foo();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment