- The command console.log(1) gets into call stack and executing there.
- Next, the command setTimeout(func,0) tells to call stack to run the callback when all current stream is finished.SetTimeout makes it async and gets out function from the curren stream.Callback's gonna go to web Api,callback queue and call stack.
- Finally,console.log(3) is gonna run before setTimeout callback, cause this function is in current stream.