Written by Dayi Chen Wow, CLOSURE!
What is the closure How to create a colsure Why colsure
WHAT IS THE COLSURE 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).
Free variable Bind variable Expression Execution context:global execution context and associated execution context Scope Chain,Scope,Activation object Global variable, Local variable,Parameter Function Higher order function
HOW TO CREATE A COLSURE Function -> Higher order function Function -> Object
WHY COLSURE Protect your variables Keep references for delayed execution Singleton pattern
OTHERS Closure in FP/OOP http://www.jibbering.com/faq/notes/closures/
Thank You

Wow! closure in_javascript

  • 1.
    Written by DayiChen Wow, CLOSURE!
  • 2.
    What is theclosure How to create a colsure Why colsure
  • 3.
    WHAT IS THECOLSURE 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).
  • 4.
    Free variable Bindvariable Expression Execution context:global execution context and associated execution context Scope Chain,Scope,Activation object Global variable, Local variable,Parameter Function Higher order function
  • 5.
    HOW TO CREATEA COLSURE Function -> Higher order function Function -> Object
  • 6.
    WHY COLSURE Protectyour variables Keep references for delayed execution Singleton pattern
  • 7.
    OTHERS Closure inFP/OOP http://www.jibbering.com/faq/notes/closures/
  • 8.