You mention that an async function is not run in the main thread but run in the background. I don't think that is 100% accurate. The function does get invoked and pushed onto the callstack in the main thread, however when that code execution comes across the await keyword that function is moved off the main thread to allow the next code execution to contiue and once all other code is executed then the async function is moved back onto the main thread.
Really worth watching... You will surely groww very soon. Keep educating us.
Thanks a ton
Thanx!
loved it 😁
Please share this channel with others if you like my videos...🤝🤝
You mention that an async function is not run in the main thread but run in the background. I don't think that is 100% accurate. The function does get invoked and pushed onto the callstack in the main thread, however when that code execution comes across the await keyword that function is moved off the main thread to allow the next code execution to contiue and once all other code is executed then the async function is moved back onto the main thread.
You are right. That's what happens. i will have to update this lecture for missing that point. Thanks for pointing this out :)