Whenever we run a JavaScript program inside a web browser, JavaScript code is received by the browser's engine and the engine runs the source code to obtain the output. In a standard JavaScript engine, the source code goes through several steps and gets executed as you can see in the above given diagram.