DEV Community

Discussion on: JS interview in 2 minutes / Promise

Collapse
 
firaskh1992 profile image
firas khateeb • Edited

hey Nikita,
Thanks for sharing such a great article,
one more thing I suggest to replace setTimeout with queueMicrotask, since then/catch/finally callbacks is a microTasks and not Tasks as setTimeout callback.

in such a case promises callback will be passed by JS engine into the microTask queue.