here are two ways to create array in JavaScript like other languages:
a) The first way to create array
Declare Array:
var names = new Array();
Add Elements in Array:-
names[0] = "Vikas";
names[1] = "Ashish";
names[2] = "Nikhil";
b) This is the second way:
var names = new Array("Vikas", "Ashish", "Nikhil");