-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtask12.js
More file actions
27 lines (19 loc) · 972 Bytes
/
task12.js
File metadata and controls
27 lines (19 loc) · 972 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
26
27
import { getRandomNumberSlowly } from "./promises.js";
/*
- Create a function that generates 3 random number. Log this 3 numbers to the console.
- This time use only the getRandomNumberSlowly() function.
- Run the promises concurrently with the Promise.all() or Promise.allSettled() functions.
- You can choose between the then and the async await syntax.
Goal: Concurrent promise execution.
Hints:
- https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/all
- https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/allSettled
Questions:
- What is the difference between the sequential and the concurrent execution of the promises?
- When starting the Promise operation?
- What is the difference between Promise.all() and Promise.allSettled()?
- What is the type of return value of the Promise.all() and Promise.allSettled()?
*/
const task = () => {
}
task()