Javascript build-in Array object reference.
Create arrays:
To create an array: | new Array([param]) |
You uses the new keyword to create an array object. | |
To use as a function: | Array([param]) |
When the Array object is used as a function the return will be an array as well. | |
param: | The param argument is optional. If it is absent an empty array is returned.
If the param argument is present it can be one of the following:
|
An example of using the new Array(param):
|
General information about the object member types:
- Prototype created methods, properties or constants can only be used on instances of an object or on a primitive datatype.
- Constructor created methods, properties or constants can NOT be used on instances of an object or on a primitive datatype.
Prototype Methods:
Syntax: | concat([item1[ ,item2 [, ...]]]) |
When the concat method is called with zero or more arguments item1, item2, etc., it returns an array containing the array elements of the object followed by the array elements of each argument in order. | |
Return value: | A new array. |
An example of using the concat() :
|
Prototype Properties:
Syntax: | Array.prototype.constructor |
This property of the Array.prototype holds the reference back to the Array object. | |
Important note: | This is the same as the constructor property of an instantiated object |
Constructor (Array) Properties:
Syntax: | Array.constructor |
The constructor property is a reference to the function that will be invoked to create a Array object. |
© 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.