6. treats computation as the evaluation of
mathematical functions
avoids state and mutable data
output value of a function
depends only on the input
Montag, 16. November 2009
11. Demo
sum.html
http://static.uxebu.com/~cain/functional-examples/sum.html
Montag, 16. November 2009
12. Function
creates scope
what else can?
Montag, 16. November 2009
13. •(function(){})()
• create scope
•(function(d){...})(dojo)
• reduce side effects
• prototype overriding can screw you!
Montag, 16. November 2009
14. •(function(d){...})(dojo)
• reduce side effects
• prototype overriding can screw you!
• function returning a function
• apply/call allow to pass context
• closures
Montag, 16. November 2009
15. Demo
create-scope.html
http://static.uxebu.com/~cain/functional-examples/create-scope.html
Montag, 16. November 2009