JavaScript execution context

Syntax parser

If we consider a block of code as a plain English paragraph document then syntax parser is the one which validates if the grammar is correct.

When we write code it's human readable but not machine. Compiler converts that written code into machine understandable language, syntax parser is the one which plays role to make sure the written code is syntactically correct and ready for compiler input.

lexical environment

It talks about where the code is written because it is important. For example if you write a code with variable 'a' where variable 'a' is written within the code determines where it situates in memory during runtime.

function hello () { var a = 'hello world !'; }

Execution Context

During runtime there are lots of lexical environments, the one is currenlty running is managed by what is called execution context. It holds the running codes and beyond.

We will discuss more on this later.


Back Next