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 |
List some of the disadvantages of javascript.
What are JavaScript types?
What are the benefits of learning javascript?
Can you give an example showing javascript hoisting?
what does javascript null mean?
Name some of the ways in which Type Conversion is possible?
Where javascript variables are stored?
How are tag positions used in javascript?
why can't we call a static method from a non-static method
What applications use javascript?
What is the difference between .call() and .apply()?
What does two exclamation marks mean in javascript?