How do I access the array at B? I have tried to console.log .circle["[[Scopes]]"]["0"].B but it says "Cannot read property '0' of undefined".
Asked
Active
Viewed 250 times
0
-
Try `circle.Scopes[0].B` – Frederik Hansen Oct 09 '17 at 20:51
-
Not at all. `[[Scopes]]` is an internal property of a closure. You cannot access it. Show us the code. – Bergi Oct 09 '17 at 20:59
2 Answers
1
circle
appears to be a function, and what you're looking at there appears to be debug information about the functions prototype.
I don't think you'll be able to get access to those values at runtime.

justin.m.chase
- 13,061
- 8
- 52
- 100
1
That is showing you debug information about the closures that are available to the function. If you are writing code which is inside the circle
function, then you can just type B
to interact with that variable. But if you are outside of the circle function, you have no way to access its closures.

Nicholas Tower
- 72,740
- 7
- 86
- 98