Created
June 28, 2018 08:53
-
-
Save sreepurnajasti/4c2e7fa58469aaa0b615b67d8348fa95 to your computer and use it in GitHub Desktop.
use of async await functionality
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
function resolveAfter2Seconds(x) { | |
return new Promise(resolve => { | |
//resolve(x) | |
}); | |
} | |
async function f1() { | |
var x = await resolveAfter2Seconds(10); | |
console.log(x); // 10 | |
} | |
f1(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment