(javascript) what is the wrap function used for regarding event handlers?
I'm trying to understand why people use a wrap function for my event handlers. For example: Example.prototype.wrap = function(obj, method) { return function(event) { obj[method](event); } } Basically, what is wrap used for? Edit: From the example linked below, the code is: String.prototype.capitalize = String.prototype.c...