You’re reading the English version of this content since no translation exists yet for this locale. Bu makaleyi çevirmemize yardım edin!
The Function.prototype
property represents the Function
prototype object.
Description
Function
objects inherit from Function.prototype
. Function.prototype
cannot be modified.
Properties
Function.prototype.arguments
- An array corresponding to the arguments passed to a function. This is deprecated as property of
Function
. Use thearguments
object available within the function instead. Function.arity
Used to specifiy the number of arguments expected by the function, but has been removed. Use thelength
property instead.Function.prototype.caller
- Specifies the function that invoked the currently executing function.
Function.prototype.length
- Specifies the number of arguments expected by the function.
Function.prototype.name
- The name of the function.
Function.displayName
- The display name of the function.
Function.prototype.constructor
- Specifies the function that creates an object's prototype. See
Object.prototype.constructor
for more details.
Methods
Function.prototype.apply()
- Calls a function and sets its this to the provided value. Arguments can be passed as an
Array
object. Function.prototype.bind()
- Creates a new function which, when called, has its this set to the provided value, with a given sequence of arguments preceding any provided when the new function was called.
Function.prototype.call()
- Calls a function and sets its this to the provided value. Arguments can be passed as they are.
Function.prototype.isGenerator()
- Returns
true
if the function is a generator; otherwise returnsfalse
. Function.prototype.toSource()
- Returns a string representing the source code of the function. Overrides the
Object.prototype.toSource
method. Function.prototype.toString()
- Returns a string representing the source code of the function. Overrides the
Object.prototype.toString
method.
Specifications
Specification | Status | Comment |
---|---|---|
ECMAScript 1st Edition (ECMA-262) | Standard | Initial definition. Implemented in JavaScript 1.1 |
ECMAScript 5.1 (ECMA-262) The definition of 'Function.prototype' in that specification. |
Standard | |
ECMAScript 2015 (6th Edition, ECMA-262) The definition of 'Function.prototype' in that specification. |
Standard | |
ECMAScript Latest Draft (ECMA-262) The definition of 'Function.prototype' in that specification. |
Draft |
Browser compatibility
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.
Update compatibility data on GitHub
Desktop | Mobile | Server | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
prototype | Chrome Full support 1 | Edge Full support 12 | Firefox Full support 1 | IE Full support 4 | Opera Full support Yes | Safari Full support Yes | WebView Android Full support 1 | Chrome Android Full support 18 | Firefox Android Full support 4 | Opera Android Full support Yes | Safari iOS Full support Yes | Samsung Internet Android Full support 1.0 | nodejs Full support Yes |
Legend
- Full support
- Full support