the callback function in settimeout is called afetr the specified time or at the end when all lines are executed
and when the thread gets empty
Settimeout function not clear
Javascript runs on a single thread. The setTimeout callbacks are scheduled in the event loop. To understand this statement, read this
And then this
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.