I have some trivial doubts regarding Asynchronous functions.
-
When await keyword is encountered in async function, what does js exactly do ?
does it skip the whole function and goes to next next instruction outside the function or will it try to execute rest of the code in async ( i personally think the first one as whatever inside a async func is supposed to be executed after the asynchronous instruction) -
Javascript has single thread and event based model. so if it encounters asynchronous code, i have read that it works in the background executing other instruction. what does executing in the background mean (if only it has single thread)?
-
If in a code every instruction is depends on result of previous async function ,doesn’t executing in both synchronously and asynchronously becomes same ?
Kindly answer these question whenever you have time.
Thanks in advance.