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() :
Syntax:
join(separator)
The elements of the array are converted to strings, and these strings are then concatenated, separated by occurrences of the separator.
If no separator is provided, a single comma is used as the separator.
Return value:
A string.
separator:
An optional separator string that is inserted between each of the array string-values.
An example of using the join() :
Syntax:
pop()
The last element of the array is removed from the array and returned.
Return value:
Last element value
An example of using the pop() :
Syntax:
push([item1][,item2][,...]))
The arguments are appended to the end of the array, in the order in which they appear.
The new length of the array is returned as the result of the call.
Return value:
The new length of the array.
item(s):
One or more items to be appended to the array
An example of using the push() :
Syntax:
reverse()
The elements of the array are re-arranged so as to reverse their order.
The object is returned as the result of the call.
Return value:
The re-arranged array.
An example of using the reverse() :
Syntax:
shift()
The first element of the array is removed from the array and returned.
Return value:
The first element of the array.
An example of using the shift() :
Syntax:
slice(start, end)
The slice method takes two arguments, start and end, and returns an array containing the elements of the array from element start up to, but not including, element end (or through the end of the array if end is undefined).
If start is negative, it is treated as (length+start) where length is the length of the array.
If end is negative, it is treated as (length+end) where length is the length of the array.
Return value:
A new array that contains the elements of array from the element specified by start, up to, but not including, the element specified by end.
start:
Index number of the start element to be included.
end:
Index number of the end element, but not to be included.
An example of using the slice() :
Syntax:
sort(comparefn)
The elements of this array are sorted and returned.
If the comparefn is not specified the method will sort the array as if there are strings to be sorted. Data values ??in the array elements that are not strings will be temporarily converted to strings before sorting is performed.
For an ascending sort; comparefn function must return a positive value if the first parameter value is considered to be greater than the second parameter value and a negative value for the opposite.
For an descending sort; compare function must return a negative value if the first parameter value is considered to be greater than the second parameter value and a positve value for the opposite.
Return value:
The sorted array.
comparefn:
A function that accepts two arguments x and y and return either a value >0, 0, or <0
When called with two or more arguments start, deleteCount and (optionally) item1, item2,
etc., the deleteCount elements of the array starting at array index start are replaced by the arguments item1, item2.
Return value:
An array with the deleted items.
start:
Start index for the insertion and/or deletion of items.
deleteCount:
The number of elements, starting with and including start index, to be deleted from array.
item(s):
Zero or more Items to be inserted into the array, beginning at the index specified by start parameter.
An example of using the splice() :
Syntax:
toLocaleString()
The elements of the array are converted to strings using their toLocaleString methods, and these strings are then concatenated, separated by occurrences of a separator string that has been derived in an implementationdefined
locale-specific way.
The result of calling this function is intended to be analogous to the result of
toString, except that the result of this function is intended to be locale-specific.
Return value:
A string
Syntax:
toString()
The result of calling this function is the same as if the built-in join method were invoked for this object with no argument.
Return value:
A string
Syntax:
unshift([item1][, item2][,...])
The arguments are prepended to the start of the array, such that their order within the array is the same as the order in which they appear in the argument list.