Mega Code Archive

 
Categories / JavaScript DHTML / Language Basics
 

Methods and Properties of the Array Object

+---------+---------------+-----------------------------------------------------+   Type      Item            Description +---------+---------------+-----------------------------------------------------+   Method +---------+---------------+-----------------------------------------------------+            concat()         Concatenates the elements passed into an existing array.  +---------+---------------+-----------------------------------------------------+            join()           Concatenates all elements of an array into one string. +---------+---------------+-----------------------------------------------------+            pop()            Deletes the last element of an array. +---------+---------------+-----------------------------------------------------+            push()           Adds elements to the end of an array. +---------+---------------+-----------------------------------------------------+            reverse()        Reverses the order of the elements in the array.  +---------+---------------+-----------------------------------------------------+            shift()          Deletes elements from the front of an array. This  +---------+---------------+-----------------------------------------------------+            slice()          Returns a subsection of the array. +---------+---------------+-----------------------------------------------------+            sort()           Sorts elements in array. +---------+---------------+-----------------------------------------------------+            splice()         Inserts and removes elements from an array. +---------+---------------+-----------------------------------------------------+            toSource()       Converts elements to a string with square brackets.  +---------+---------------+-----------------------------------------------------+            toString()       Converts the elements in an array to a string. +---------+---------------+-----------------------------------------------------+            unshift()        Adds elements to the front of an array. +---------+---------------+-----------------------------------------------------+            valueOf()        Returns an array of elements separated by commas. +---------+---------------+-----------------------------------------------------+  Property +---------+---------------+-----------------------------------------------------+            index            For an array created by a regular expression match,                              this property returns the indexed location of the match.  +---------+---------------+-----------------------------------------------------+            input            For an array created by a regular expression match,                              this property returns the original string. +---------+---------------+-----------------------------------------------------+            length           The number of elements in the array. +---------+---------------+-----------------------------------------------------+            prototype        Provides the capability for a programmer to add                              properties to instances of the Array object.  +---------+---------------+-----------------------------------------------------+