Function.createDelegate Function

Creates a delegate function that retains the context first used during an objects creation.

var a = objVar.createDelegate(instance,method);

Arguments

  • instance
    The object instance that will be the context for the function.

  • method
    The function from which the delegate is created.

Return Value

A delegate function.

Remarks

Use the createDelegate function when setting up an event handler to point to an object method. The createDelegate function is useful when setting up an event handler to point to an object method that must use the this pointer within its scope. The createDelegate function can also be used with a null instance.

See Also

Other Resources

Language Reference