Skip to content Skip to sidebar Skip to footer

Array in javascript

     Array can store more than one values but same data type. push method is used to insert the values into array, when you want to store the values into array you can use this push method.


syntax

array_var.push(value);

Example

--------
--------
var arr=[];
for(i=0;i<5;i++)
{
arr.push(i);
}
--------
--------



Example Program:- (Editor)


Editor is Loading...

Advertisement

Post a Comment for "Array in javascript"