JavaScript Array Object

JavaScript Array Object

Array Object is an object that allows us to create and manipulate table, the following is the syntax to create tables:
var x = new Array (element1 [, element2, ...]);

If no element specified in the parameters, the table will be empty table at the time it is made, otherwise if the element is filled, the contents of the table will be initialized by value of the element. In addition to the array object has two characteristic properties namely the input and the length property.

The following table lists some standard methods of the object array :

concat (tab1, tab2 [, tab3, ...])

allows us to add (concatenate) a lot of tables, in the sense of making a table from several different tables which is passed as a parameter method.

join (table) or Table.join ()
sends a string variable that contains all the elements of the table

pop (table) or Table.pop ()
remove the last element of the table.

Table.push (value1 [, value2,. ...])
adding one or more elements to the table

Table.reverse ()
reverse of elements in the table

Table.shift ()
remove first element of the table

Table.slice ()
sends a table that contains some elements from the main table

Table.splice ()

to add and reduce the element table

Table.sort ()
sort the table elements

Table.unshift (value1 [, value2, ...])
sent back to the source code that allows us to create object arrays.

Table.toString ()
sends back a string variable associated with array object instruction

Table.unshift ()
to add back one or several elements at the beginning of the table

Table.valueOf ()
returns the value of the array object where the array objects that become a reference from the table.


Post a Comment