This file contains 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
// PROMISES! | |
// There are two ways to work with promises. | |
// Option 1 the easiest once you understand it. | |
// JavaScript has a feature called Async-Await | |
// Notice the *async* keyword before function | |
async function asyncPattern() { | |
// In async functions, you can get the result of | |
// promises without .then. Just stick a 'await' | |
// in front of it and it will wait for the promise |