I run the snippets in chrome and watch the variables.
However, something puzzled me:
the variables a
,b
,c
are all declared in the closure scope, but a
and b
are not available. Please make clear why this happens?
The offcial Doc doesn't make it clear.
I make an assumption:“The variable in chrome's watch expression must be used in the local scope or it's declared in the global scope, otherwise it's not available even if it has been declared in closure scope”. It's the proposition correct?
Chrome version:60.0.3
The following is my code for you to test:
var globalV = 123;
;(function(){
var a = function(){}
var b = function(){a()}
var c = function(){b()}
var d = function(){
debugger
c()
}
d()
})()