Different types of Scopes
Last updated
Last updated
Any variable that's not inside a function or block (curly brace).
Any variable declared inside a function
This refers to let
and const
which unlike var
are only accessible within the scope that they were defined.
Lexical Scope (also known as Static Scope) literally means that scope is determined at the (generally referred to as compiling) rather than at runtime.
Scope determined by the this
keyword during function invocation.