How can I define an array in JavaScript?
Answers were Sorted based on User's Feedback
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 |
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 |
Is javascript insecure?
e=1+x/!+x2/2!+x3/3!+.... in javascript
Name some of the ways in which Type Conversion is possible?
How to get the primitive value of a string in Javascript?
What is the difference between undefined and object?
What is global variable in javascript?
What is null in programming?
How to have the status line update when the mouse goes over a link (the support of the status line is sporadic)?
what is runnable interface
Where should I put script tags?
What is the output of 10+20+”30″ in JavaScript?
How to include the HTML tag inside the javascript tags?