- Fork this repo so you can push your changes when you finish
- Make sure you have installed node
v7.8.0
or newer - Perform a
npm i
in the project folder. - Code
Edit async.js
:
You'll find several empty functions along with a main
and a randomNumber
. You can complete this exercise by running this code with node (or in your editor directly). You're goal is to log a random number provided by the randomNumber
function in the main
function. You're only allowed to call console.log
in the main
function.
-
Get the random number after a second calling
timeoutRandomNumber
. -
Do the same but now calling
promiseRandomNumber
, which is meant to wrap the first function with a promise. -
Use
asyncRandonNumber
which has to usepromiseRandomNumber
but using the keywordsasync/await
.