In this example, Google Chrome Devtools won't find variable "y" in closure scope, but it will show "x".
My guess is that "y" won't appear because it's not used.
Am I right?
In this example, Google Chrome Devtools won't find variable "y" in closure scope, but it will show "x".
My guess is that "y" won't appear because it's not used.
Am I right?
It looks like it's engine dependent.
On Google Chrome (Version 70.0.3538.77 (Official Build) (64-bit)), I can't see "y" variable:
However on Firefox variable "y" is accessible:
I'm not sure how these engines work, I assume Chrome during compile time have a look at variable "y" and says "hey it's not used in this scope, we don't need it". Whereas Firefox includes it.