Created
August 17, 2019 05:56
-
-
Save sobiodarlington/f8643f6aab7702c85c40cefbd93196e0 to your computer and use it in GitHub Desktop.
Async await example
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
// Arithmetic addition function | |
async function add(a, b) { | |
return a + b; | |
} | |
// Usage: | |
add(1, 3).then(result => console.log(result)); | |
// Prints: 4 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment