Differences of function.apply() and function.call() in JavaScript
Function object methods function.apply() and function.call() basically do the same job, that is to invoke the function as if it was the method of a specified object so that the ‘this’ keyword within the function is treated as that object rather than the global object. var x = 20; function f(s) { alert(this.x + s); …
Differences of function.apply() and function.call() in JavaScript Read More »