How JavaScript and JavaScript engine work in browser?
In this article, we will learn how javascript and javascript engine works in the browser.
Every Browser has one javascript engine, using this browser can run the javascript code
So, inChorme we have a V8 engine, which does this job for us.
Same Mozila has spidermonkey and safari has safari engine which makes it possible to run javascript code in the browser.
Every javascript engine has a parser who parses our code.
so, here parser checks your javascript code line by line because javascript is interpreted language.
so, whenever the parser gets any error in your code, it stops execution and throws the error.
Once the parser finds everything fine then it prase your code to machine code and then your code will run.