MCPcopy Create free account
hub / github.com/marijnh/Eloquent-JavaScript / soon

Function soon

code/solutions/11_3_building_promiseall.js:20–24  ·  view source on GitHub ↗
(val)

Source from the content-addressed store, hash-verified

18 console.log("This should be []:", array);
19});
20function soon(val) {
21 return new Promise(resolve => {
22 setTimeout(() => resolve(val), Math.random() * 500);
23 });
24}
25Promise_all([soon(1), soon(2), soon(3)]).then(array => {
26 console.log("This should be [1, 2, 3]:", array);
27});

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected