alert("Hi! Welcome to linuxhint.com");
Add the given code in an HTML file and open it in your browser. Upon doing so, the following “alert” box will appear in the browser:
To check the output of the “console.log()” method, right-click in the opened window and select the “Inspect” option from the context menu:
The given output signifies that the “console.log()” method has successfully displayed the specified string in the console:
At this point, you may be wondering how the web browser understands the code and executes it effortlessly?
Now, let’s take a closer look at each of these processes.
Step 2: Creating Abstract Syntax Tree
Step 4: Executing Machine code
Lastly, the converted code is submitted to the system for execution, and then the corresponding byte code is executed.