Context vs Scope

Scope

  • Scope refers to the visibility of the variables.

  • Scope means what is the variable access of a function when it's invoked

  • What is in the variable environment

Context

  • Context is more Object based

  • Context says what the value of this keyword

  • this meaning what is the reference to the object that owns that current executing code

  • Context is most often determined by how a function is invoked with the value of this keyword

Last updated