<script language="javascript">
Arr1=new Array("RED","YELLOW","GREEN","BLUE","WHITE","BLACK") ;
Arr1.splice(1,0,"PINK","ORANGE");
/*If you put 1 in place of 0 then one element will be removed from the array and if you put 0 inplace of 1
elements added from the begining of the array */
for(i=0;i<Arr1.length;i++)
{
document.write(Arr1[i]+"<br/>");
}
No comments:
Post a Comment