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 main difference between Client side JavaScript and and Server side Java Script?

7 Answers   Ramco,


Is JavaScript a true OOP language?

0 Answers  


How to select an element by id and swapping an image?

0 Answers  


How to prevent a window not to be clicked or selected any way in java script?

0 Answers  


What is the use of blur function in JavaScript?

0 Answers  






How to prevent modification of an object in Javascript?

0 Answers  


What is createtextnode?

0 Answers  


Explain closures in javascript?

0 Answers  


Consider the following code: 1 2 3 4 5 (function() { var a = b = 5; })(); console.log(b); what will be printed on the console?

0 Answers  


To write messages to the screen without using "document.write()"?

0 Answers  


How you can modify XAML content from JavaScript in Silverlight?

0 Answers  


Do hackers use javascript?

0 Answers  


Categories