generated from CodecoolArchive/async-workshop-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtask4.js
More file actions
25 lines (17 loc) · 650 Bytes
/
task4.js
File metadata and controls
25 lines (17 loc) · 650 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import { getRandomNumber } from "./promises.js";
/*
- Create a function that logs a random number to the console.
- Use the getRandomNumber function for it.
The getRandomNumber function do not receive any arguments, but it returns a Promise
that fulfills to a random number after a while.
syntax: getRandomNumber(): Promise<number>
example: getRandomNumber()
- use the `then syntax`
Goal: Handle the promise fulfilled value.
Questions:
- How can we get back, how can we "unpack" the fulfilled Promise value?
- How would you name the fulfilled value for this particular case?
*/
const task = () => {
}
task()