I don't know JS at all, so I'm interested in this example. Can you really pass in a function like this and have the referencing to the variable "sum" work as you would want?
Can someone explain (or point to an explanation of) the scoping rules for me?
Thanks.