How can I define an array in JavaScript?

Answers were Sorted based on User's Feedback



How can I define an array in JavaScript?..

Answer / shini nino

var arrQualif=new Array();

Is This Answer Correct ?    30 Yes 10 No

How can I define an array in JavaScript?..

Answer / madhav arora

Arrays can be defined in following three ways :

1. regular method:
ex: var arrayname=new Array();
arrayname[0]="abc";
arrayname[1]="pqr";
arrayname[2]="xyz";

2.condensed method:
ex: var arrayname=new Array("abc","pqr","xyz");

3.literal method:
ex:var arrayname=["abc","pqr","xyz"];

Is This Answer Correct ?    16 Yes 4 No

How can I define an array in JavaScript?..

Answer / hiren garasia

array arrayname=new array[];

Is This Answer Correct ?    17 Yes 11 No

How can I define an array in JavaScript?..

Answer / hiren b garasia

4.dense method:
ex: var days=new
Array('Mon','Tue','Wed','Thus','Fri','Sat','Sun');

Is This Answer Correct ?    5 Yes 4 No

Post New Answer

More JavaScript Interview Questions

What is the difference between a web-garden and a web-farm?

0 Answers  


What is the importance of javascript?

0 Answers  


What are the different actions that are performed using javascript?

0 Answers  


Name some of the built-in methods and the values returned by them.

0 Answers  


Describe what u had done today?

0 Answers   Genpact, Sams,


Hi Friends, I am new to java, please provide some use full docs, and where can i get basic Java script docs... thanx in advance

8 Answers  


What is javascript hoisting?

0 Answers  


How to toggle display an html element?

0 Answers  


What is the difference between window and document in Javascript?

0 Answers  


What are the variable naming conventions in javascript?

0 Answers  


How do you change the style/class on any element using javascript?

0 Answers  


what is lazy fetching in hibernate

0 Answers   iGate, Infosys,


Categories