Javascript Function reference.
Javascript build-in Function object reference.
Using Function:
Prototype Methods:
Syntax: | apply(thisArg,argArray) |
Make a call to the function specified as if there was a method in thisArg object and use any arguments (given as an array) that follow thisArg in the argument list.
The thisArg object is the value of "this" keyword in the body of the function If thisArg is null or undefined, the called function is passed the global object as the this value. A 'TypeError' will be thrown if the method is invoked on an object that is not a function. |
|
Return value: | The value returned by the called function. |
thisArg: | The object that should be the this keyword for the method to be invoked. |
argArray: | An optional number of arguments, which will be delivered as an array of arguments to the function. |
An example of using the apply() :
|
Prototype Properties:
Syntax: | Function.prototype.constructor |
This property of the Object.prototype holds the reference back to the Function object.
It is possible to provide the constructor a refererence to another created object. |
Constructor (Function) Properties:
Syntax: | Function.constructor |
The constructor property is a reference to the function that will be invoked to create a Function object. |
Inside Function Object:
Syntax: | arguments |
The arguments object exists only inside a function, and contains all of the arguments passed to the function or method.
It has numbered properties that function as array elements. Each property contains a argument value. |
|
length: | Specifies the number of array elements. It is how many arguments that is passed to the function or method. |
callee: | A reference to the function that is currently executing. |
An example of using the arguments :
|
© 2010 by Finnesand Data.
All rights reserved.
This site aims to provide FREE programming training and technics.
Finnesand Data as site owner gives no warranty for the
correctness in the pages or source codes.
The risk of using this web-site pages or any program
codes from this website is entirely at the individual user.