Created
July 17, 2017 12:34
-
-
Save johnstew/5800b09b9e8acaf1f6c9dfbaf114976b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Variable Assignment | |
const getData = async function () { | |
try { | |
const data = await fakeAsyncCall(); | |
console.log(data); // foo data | |
} catch (error) { | |
console.error(`Uh oh: ${error}`); | |
} | |
}; | |
// IIFE | |
(async function() { | |
try { | |
const data = await fakeAsyncCall(); | |
console.log(data); // foo data | |
} catch (error) { | |
console.error(`Uh oh: ${error}`); | |
} | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment