To pass value of ‘this’ object in a function apply and the call methods are used.
The apply() and the call() methods are used to call a function indirectly. When you call a function using the apply() and the call() methods, that is called Indirect Invocation Pattern .
The first parameter is always the value for ‘this’ object.
In the apply() method parameters are passed as an array In the call() method parameters are passed as comma-separated
Leave a Reply