Hello 

This is the day 29 of #30 days of javascrip coding, at this day I studied Scope – Lexical (Static) Lesson  and i learned that
1- The lexical scope in the function is not equivalent to if you have a nested function, then the child function can access the variables in the parent function, and so every function inside the function can access the variables of the function that is descended from it.
2-If the child function has no variables in the father function, it has access to the variables in the Global Scope
3-In this Child Function, I used the Console to print the variable a, which is present in the Parent Function. The Child function can access anything present in the Parent function.
4-If this variable a exists in the Child Scope, of course, intuitively, you will take the variable a from the Local Scope.
5-Every function inside a function accesses the variable of its parent function, but the opposite does not happen
That's what I learned today and this is the codes i have typed

Comments

Popular posts from this blog