What is the Execution Context in html?


I this session I am trying to explain what Execution Context in html is really talking about. I will see how far I have understood the topic.


When code is run in JavaScript, the environment in which it is executed is very important, and is evaluated as 1 of the following: Global code which is the default environment where the code is executed at first, then function code which is any time the flow of execution enters a function body and text to be executed inside the internal eval function.


// global context

var sayHello = ‘Hello’;

function person(){

// executive contex


var first = ‘james’;

var last = ‘Johnson’;

function firstName(){           //execution context



The are enough materials to write pages from this two references but I want to limit myself to the Execution Context in html.They gave me an indepth understanding of this topic. Understanding the execution context and stack allows you to know the reasons behind why your code is evaluating to different values that you have not initially expected. I think knowing the inner workings of the interpreter is not too much overhead or a necessity to my JavaScript knowledge.  Does knowing the execution context phase help you write better JavaScript ? This is a question that is really worth to ponder about.


Shariff, (2012) what is execution context? Available at:http://davidshariff.com/blog/what-is-the-execution-context-in-javascript/  [Accessed on 12/06/2015]

Nadel, (2009) THIS, Function Context, And Object Literals In Javascript  Available at: http://www.bennadel.com/blog/1732-this-function-context-and-object-literals-in-javascript.htm [Accessed on 12/06/2015]


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s