JavaScript Function call() methodThe JavaScript Function call() method is used to call a function contains this value and an argument provided individually. Unlike apply() method, it accepts the argument list. SyntaxParameterthisArg - It is optional. The this value is given for the call to function. arg1,arg2,...,argn - It is optional. It represents the arguments for the function. Return ValueIt returns the result of the calling function along provided this value and arguments. JavaScript Function call() method ExampleExample 1Let's see a simple example of call() method. Test it NowOutput: John Martin Example 2Let's see an example of call() method. Test it NowOutput: 101 John Martin 201 Duke William Next TopicJavaScript Function |
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India