Skip to main content

Close
Get the best research tool on the web today,and free!
Connect with people with common interests!

All Annotations of Javascript Closures[Preview]

saved by41 people, first bySérgio Carvalho on 2006-03-02, last byarpit mathur on 2008-08-10

  • Closure

    A "closure" is an expression (typically a function) that
    can have free variables together with an environment that binds
    those variables (that "closes" the expression).
  • Closures are one of the most powerful features of ECMAScript
    (javascript) but they cannot be property exploited without
    understanding them
  • The simple explanation of a Closure is that ECMAScript allows inner
    functions; function definitions and function expressions that are
    inside the function bodes of other functions. And that those inner
    functions are allowed access to all of the local variables, parameters
    and declared inner functions within their outer function(s).
  • Function objects created with the Function constructor
    always have a [[scope]] property referring to a scope
    chain that only contains the global object.




    Function objects created with function declarations or function
    expressions have the scope chain of the execution context in which
    they are created assigned to their internal [[scope]]
    property.

  • Example 2: Associating Functions with Object Instance Methods
  • on 2006-07-25 Aka_tazzo
    e anything, so
  • on 2006-08-21 Tomwright
    An extended discussion of closures with some examples
  • on 2006-11-16 Wildoats
    excellent