1.

Differentiate between .call and .apply.

Answer»
.call.apply
.call is used to invoke the functions, and the first PARAMETER will become the value of this within the function created by the developer..apply is also used to invoke the functions but it takes an array of arguments. This array works as the next ARGUMENT and the function works this way.
.call is used to call the method which takes the owner object as its argument..apply method is used to write methods. These methods can be used on several objects.
It accepts two parameters namely objectInstance and argumentsIt accepts two parameters namely objectInstance and arrayofArguments
.call takes several arguments SEPARATED by COMMAS..apply takes several arguments with the HELP of an array of arguments.


Discussion

No Comment Found