Created
September 29, 2020 18:05
-
-
Save colinta/c419958a2834ad6c1fbad61525d74fbb to your computer and use it in GitHub Desktop.
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
async function foo() { | |
console.log('foo'); | |
return 'foo'; | |
} | |
function bar() { | |
return new Promise(resolve => { | |
console.log('bar'); | |
resolve('bar'); | |
}); | |
} | |
const a = foo(); | |
const b = bar(); |
Author
colinta
commented
Sep 29, 2020
•
https://www.javascriptjanuary.com/blog/the-promise-of-a-better-future#eagerness
Promises are eager. This means that when a new Promise is constructed, it immediately starts executing, attempting to resolve the asynchronous value
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment