Promise

Report a typo

This is a block of code that you have to change by adding console.log("microtask"); before timeout but after promise logs.

Tip: Use promise

Sample Input 1:

Sample Output 1:

Write a program in JavaScript
setTimeout(() => console.log("timeout"));

Promise.resolve()
.then(() => console.log("promise"));

console.log("code");
___

Create a free account to access the full topic