Skip to content
Onsite

Output: async function with logs before and after an await, called between two sync logs

MediumP1Output

What does this code print?

1async function load() {
2 console.log('load start');
3 await Promise.resolve();
4 console.log('load end');
5}
6console.log('before');
7load();
8console.log('after');
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