Member-only story
Javascript Execution Context and Hoisting

This article is for those who don’t know how JavaScript is executed.
Prerequisite: You should know
Before we start can you answer below?
Is Javascript an Interpreted or a compiled language?
Yes, Javascript (JS) is an interpreted language, still has its own form of a compiler, run in what’s known as the Javascript engine.
Every web browser has its own form of a JavaScript engine Eg. Chrome has v8 and Mozilla has spider monkey etc, though they all have the same purpose. JavaScript engines simply convert JavaScript source code into a language the compiler can understand, then executes it.
Let’s start then,
Execution Context
An environment in which the javascript code runs is what form an execution context.
The execution context decides what particular piece of code has access to variables, functions, objects, etc.
If you have read the scope article then you should know what’s the global scope and local scope(function scope).