When I open up Chrome (v35) DevTools and inspect an object, the console can show me things nested within functions, including something labeled as the '"function scope".
For example, when looking at stackoverflow.com, I can see that there's a global $
object containing another function called Callbacks
. Callbacks
, as does $
, has a functional scope containing Closure
and Global
.
- Question 1: What is the difference between some named object nested directly within a function and some object contained within a Closure in its function scope?
- Question 2: How do I programmatically reference a function scope in the console?
window.$.Callbacks.???
? chrome.function???(window.$.Callbacks)
The reason I ask is because I'm looking for memory leaks and would like to search the objects held within functions' closures based on object types and property names.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…