Tuesday, August 24, 2021

Creation of scope chain?

 Scope: Scope means where we can use certain variables.

In JavaScript every function creates it's own scope(Space/environment).

Lexical scoping: A function that is lexically within another function get access to the outer function .

Below is the figure of lexical scoping-





No comments:

Post a Comment

Clean code chapter 3(Robert C.martin)

  Summary: --------  1. Functions should hardly ever be 20 lines long.  2.Keep blocks (inside if, else, while, for, etc.) short.  Ideally, j...