Javascript Arrays and usage

 

javascript arrays can be defined and implemented as

var array1=new Array();

array1[0]=”v1″;
array1[1]=”v2″;
array1[2]=”v3″;

initializing array

var array1=new Array(“v1″,”v2″,”v3”);

setting up values

var array1=[“v1″,”v2″,”v3”];

display values

document.write(array1[0]);

result

v1

change values

array1[0]=”m1″;

testing

document.write(array1[0]);

result

m1

abhilash

abhilash, is a programmer by profession and a technology addict with a passion towards browsing , shopping and imaging . My views may be biased on reviews. all images and videos are copyrighted to respective owners.

Add comment

Your Header Sidebar area is currently empty. Hurry up and add some widgets.