Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const f = (wait_count, string) => (
- new Promise((res, rej) => (setTimeout(() => res(string), wait_count)))
- );
- async function sequence() {
- const a = await Promise.all([
- f(2000, '2000 wait'),
- f(500, '500 wait'),
- f(1000, '1000 wait')
- ]);
- console.log(a);
- }
- sequence()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement