All in JavaScript create inside an "Execution Context”. Where a JavaScript program is run an execution context is created. In this phase, javascript allocates the memory to all the variables and functions present in the program. Normally, JavaScript is a single threaded and single concurrent programming language which means it can handle one task at a time or, in other words, a piece of code at a time. It's an interpreted programming language, and like most scripting languages, it uses dynamic typing, where type safety is verified at the runtime.
javaScript is a runtime model based on an event loop service, which is responsible for executing the code in very much efficient way. collecting and processing events, and executing queued sub-tasks from the memory. Whenever an async function is called, it is sent to a browser API. These are APIs built into the browser. Based on the command received from the call stack, the API starts its own single-threaded operation. and it's going on the same stage.. Generally, JavaScript has a runtime model based on an event loop, which is responsible for executing the code, collecting and processing events, and executing queued sub-tasks.