Why we need Delegate -- Function.createDelegate(instance, method)?
When executing a method, there're 2 ojbects available inside the method:
- event object
- this point
1. If the method called on an DomElement, this points to the DOM element.
2. If the method called on an Object, this points to the object instance.
As to 1st case, to access the object instance in which the event handler method defined, we should create a delegate to let this point to the object instance rather than the associated DOM element -- Function.createDelegate(this, method).
Essentially, it's implemented by "method.apply(this, arguments)".