Pergunta de entrevista da empresa Canva

if you use a console.log inside a timeout with 0 second how long would it take to print

Respostas da entrevista

Sigiloso

10 de jul. de 2024

It should be printed just after all the event loop stack finishes (is empty), after that the queue messages will be run, the time at 0 ms does not guarantee it will run immediately , it will run immediately if there’s an empty stack otherwise it will be scheduled into the queue

Sigiloso

24 de abr. de 2023

the amount of time to run the timeout function

5