JavaScript
  • JavaScript Introduction
  • JS Engine
  • V8 Engine
  • First-class function
  • Optimized Code
  • Call Stack & Memory heap
  • Single Thread
  • JavaScript RunTime
  • Nodejs
  • Context and Environment
  • Hoisting
  • Functions
  • Arguments
  • Variables
  • Scope
  • IIFE
  • this
  • call(), apply() and bind()
  • currying
  • Types
  • Type Coercion
  • Functions as Object
  • HOF (Higher Order Function)
  • Two pillars of Javascript
  • Closures
  • Prototypal Inheritance
  • OOP and FP
  • OOP
    • 4 principles of OOP
  • FP
    • Pure function
    • Imperative vs Declarative
    • Immutability
    • HOF and Closures
    • Currying
    • Partial Application
    • Compose and Pipe
  • Composition vs Inheritance
  • OOP vs FP
  • JS working
  • Promises
  • Async Await
  • ES5 - ECMAScript 2009
  • ES6 - ECMAScript 2015
  • ES7 - ECMAScript 2016
  • ES8 - ECMAScript 2017
  • ES9 - ECMAScript 2018
  • ES10 - ECMAScript 2019
  • ES11 - ECMAScript 2020
  • ES12 - ECMAScript 2021
  • JOB Queue
  • Promises Execution
Powered by GitBook
On this page
  • Execution Context:
  • Lexical Environment:

Was this helpful?

Context and Environment

Execution Context and Lexical Environment

PreviousNodejsNextHoisting

Last updated 5 years ago

Was this helpful?

Execution Context:

  • When java script engine sees the brackets, creates its own execution context inside the call stack, after the execution it will popes out the call stack.

  • Any time running the java scrip code, it will be a part of execution context.

Global Execution context:

  • when ever we run the java script code, it creates a Global execution context that gives global object 'window' and 'this' and this === window.

  • After the global execution context is created, functional execution context will be created.

Lexical Environment:

  • Lexical is compile time.

  • Makes to know where the code is written.

  • Every function creates a new lexical environment.

  • Execution context says which lexical environment is currently running.

Lexical scope: (definition)

Lexical scope (available data + variables, where the function was defined) determines the available variables.

Dynamic scope: (execution)

Where the function is called.

Execution Context Operation
Execution Context