Apply Invocation Pattern:-
- The value that should be bounded to this pointer
- Array of parameters
In above example this pointer is bound to null because here the function add is not an object, so it is not needed. Now Let me show you the way we can change ‘this’ pointer.
property:”Hi Good Morning”
Here the value of the ‘this’ pointer is bound to an object called ‘greeeting’. So we can explicitly change the value of ‘this’ pointer here.
Call Invocation Pattern:-
So here we can’t create array of parameters. We have to pass all the parameters. So call invocation pattern has a signature like this:-
Here the value of this parameter is bound to the person object. So lets take another example of call invocation pattern.
So the output for the above code will be Hi,Bye,Me,Awesome.