This is an example:
function one() { var a = 1; two(); function two() { var b = 2; three(); function three() { var c = 3; alert(a + b + c);
Now, when we call the one () function, the result is 6 .
So, everything about the chain of visibility, all the variables are solved, now I have one question.
Why do we need this keyword "this" when all the variables become allowed along the chain of chains?
So, if we have the following function:
function a() { var a = 'function a'; function b() { var b = 'function b'; alert (a);
The keyword "this" always bothers me!
Someone please explain this in a simple and detailed way.
javascript scope this
Abdul raziq
source share