JavaScript call() Function
JavaScript call() Function
The call()
function calls a function or method as if it belonged to thisObj and passes individual arguments to the function or method.
Note: The call()
function passes the arguments individually. Whereas, the apply()
function passes an array of arguments.
Basic Example
The following is the basic example to be understood before proceeding with a call()
function.
Example
Syntax
Parameter Values
Value | Type | Explanation |
---|---|---|
Object | Optional | The value of thisObj provided for the call to a function. |
arg1, ..., argN | Optional | Arguments for the function. |
call() with Object and without Arguments
Example
call() with Object and Arguments
Note: The arguments are passed individually.
Example
Reminder
Hi Developers, we almost covered 97% of JavaScript Tutorials with examples for quick and easy learning.
We are working to cover every Single Concept in JavaScript.
Please do google search for:
Join Our Channel
Join our telegram channel to get an instant update on depreciation and new features on HTML, CSS, JavaScript, jQuery, Node.js, PHP and Python.
This channel is primarily useful for Full Stack Web Developer.