We can insert the value into array using following methods.
Syntax
array.push(value);
array.unshift(value);
array[index]=value;
Example
var ar=[1,2,3];
ar.push(10);
ar.unshift(8);
ar[3]=100;
Example Program:- (Editor) 
Editor is Loading...
Output:-
Advertisement
Post a Comment for "Insert value into array"