Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var addNumber=function(x){
- //first class function : a function treated as an object
- return function(y){
- //x is a free variable. (i.e. not a local variable or an argument of this function.)
- //x is bound to the argument x in lexical environment defined by the addNumber function
- return x+y;
- };
- };
Add Comment
Please, Sign In to add comment