O'Reilly logo
  • Harit Himanshu thinks this is interesting:

The function bar() has lexical scope access to the inner scope of foo(). But then, we take bar(), the function itself, and pass it as a value. In this case, we return the function object itself that bar references.


Cover of You Don't Know JS: Scope & Closures


This is important point to understand here