Function.prototype.call() vs Function.prototype.apply()
Function.prototype.call() and Function.prototype.apply() are both JavaScript Function APIs, and choosing between them is a common point of confusion. This page compares their syntax, parameters, return values, and typical use cases so you can pick the right one. Function.prototype.call(): Calls a function with a given this value and individual args. Its syntax is func.call(thisArg, ...args). Function.prototype.apply(): Calls a function with a given this value and args as an array. Its syntax is func.apply(thisArg, argsArray). Example of Function.prototype.call(): greet.call(obj, "Hello"). Example of Function.prototype.apply(): greet.apply(obj, ["Hello"]). Read the full references for Function.prototype.call() and Function.prototype.apply() to see edge cases, time complexity, browser support, and the mistakes developers most often make with each. Other Function APIs worth comparing: Function.prototype.bind(), Function.prototype.toString(), Function.length, Function.name, Function.prototype[Symbol.hasInstance](), Function.prototype.constructor. Both belong to the Function category in the JS Reference documentation, which covers 8 entries in total. Try both in the JavaScript playground to see the behavioral difference live.