Skip to content
Quiz · Asynchronous code · lesson 11 of 12

Quiz — the order of Promise.all values

What does the program print (lines separated by spaces)?

JavaScript
function wait(ms, value) {
    return new Promise((resolve) => {
        setTimeout(() => resolve(value), ms);
    });
}

Promise.all([wait(30, "a"), wait(10, "b")])
    .then((values) => console.log(values.join(" ")));
console.log("start");

Subscribe to take the course

The course is free. Sign in with Telegram and subscribe to the channel to open every lesson.

Sign in another way