call, apply and bind in javascript

call, apply and bind methods are used to invoke a method on specific object

call

call allows you to execute the given method on given object. This way object can call third party method.

apply

apply method is same as call with only one difference - apply method takes arguments in the form of array.

bind

with bind method, called method does not return immediately. But we get other method which we can call later with extra parameters when available.


Complex problems, Simple Solutions