Prevent JavaScript closure from inheriting scope
I am looking for a fancy way to prevent a closure from inheriting surrounding scrope. For example:
I am looking for a fancy way to prevent a closure from inheriting surrounding scrope. For example:
I need a callback function that is almost exactly the same for a series of gui events. The function will behave slightly differently depending on which event has called it. Seems like a simple case to me, but I cannot figure out this weird behavior of lambda functions.