Skip to content
Onsite

Output: two independent promise chains of three thens each, started together

MediumP2Output

What does this code print?

1Promise.resolve()
2 .then(() => console.log('A1'))
3 .then(() => console.log('A2'))
4 .then(() => console.log('A3'));
5
6Promise.resolve()
7 .then(() => console.log('B1'))
8 .then(() => console.log('B2'))
9 .then(() => console.log('B3'));
Saved automatically

One line per console.log. Arrays as [1, 2, 3], objects as { a: 1 }, an uncaught error as Uncaught TypeError: message (Chrome and Node wording).

Hints

Saved automatically