Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

difference between call and apply in js

/*
call() Method: It calls the method, taking the owner object as argument. 
The keyword this refers to the ‘owner’ of the function or the object 
it belongs to. We can call a method which can be used on different objects. 

apply() Method: The apply() method is used to write methods,
which can be used on different objects. 
It is different from the function call() because it takes arguments as an array.
*/
Source by www.geeksforgeeks.org #
 
PREVIOUS NEXT
Tagged: #difference #call #apply #js
ADD COMMENT
Topic
Name
6+8 =