Class Function
The Function class represent a JavaScript function.
Property Summary
Property Description length : Number The number of named arguments that were specified when the function was declared. prototype : Object An object that defines properties and methods shared by all objects created with that constructor function.
Constructor Summary
Constructor Description Function (String… )Constructs the function with the specified arguments where the last argument represents the function body and all preceeding arguments represent the function parameters.
Method Summary
Method Description apply (Object , Array )Invokes this function as a method of the specified object passing the specified Array of arguments. call (Object , Object… )Invokes this function as a method of the specified object passing the specified optional arguments. toString ()Returns a String representation of this function object.
Methods inherited from class Object
assign , create , create , defineProperties , defineProperty , entries , freeze , fromEntries , getOwnPropertyDescriptor , getOwnPropertyNames , getOwnPropertySymbols , getPrototypeOf , hasOwnProperty , is , isExtensible , isFrozen , isPrototypeOf , isSealed , keys , preventExtensions , propertyIsEnumerable , seal , setPrototypeOf , toLocaleString , toString , valueOf , values
Property Details
length
length: Number
The number of named arguments that were specified
when the function was declared.
prototype
prototype: Object
An object that defines properties and methods
shared by all objects created with that
constructor function.
Constructor Details
Function(String...)
Function(args: String... )
Constructs the function with the specified arguments where the
last argument represents the function body and all preceeding arguments represent
the function parameters.
Parameters:
args - one or more Strings where the last argument in the list represents the function body and all preceeding arguments represent the function parameters.
Method Details
apply(Object, Array)
apply(thisobj: Object , args: Array ): Object
Invokes this function as a method of the specified object
passing the specified Array of arguments.
Parameters:
thisobj - the object to which the function is applied.
args - Array of values or an arguments object to be passed as arguments to the function.
Returns:
whatever value is returned by the invocation of the function.
call(Object, Object...)
call(thisobj: Object , args: Object... ): Object
Invokes this function as a method of the specified object
passing the specified optional arguments.
Parameters:
thisobj - the object to which the function is applied.
args - an optional list of one or more arguments values that are passed as arguments to the function.
Returns:
whatever value is returned by the invocation of the function.
toString()
toString(): String
Returns a String representation of this function object.
Returns:
a String representation of this function object.