A closure is the combination of a function and the lexical environment within which that function was declared.
display
closure has access to its surroundings in order to display the name
variable. It can manipulate it, add to it, remove from it and more.makeAdder
creates a function that will add the passed in variable with another via a delay of execution. You can then execute the resultant closures add
with another number to get your calculation of 3
in this case.map(), reduce(), filter(), each(), etc
where you can pass closures into other functions for operating on different data structures.local
scopearguments
scopelocal
scope if availablelocal
scope if availableisClosure()
that allows you to evaluate if a variable is a closure or not:function
keyword, curly braces and return
statement. Lambda expressions implicitly return the results of the expression body.