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 |
What is the main difference between Client side JavaScript and and Server side Java Script?
Is JavaScript a true OOP language?
How to select an element by id and swapping an image?
How to prevent a window not to be clicked or selected any way in java script?
What is the use of blur function in JavaScript?
How to prevent modification of an object in Javascript?
What is createtextnode?
Explain closures in javascript?
Consider the following code: 1 2 3 4 5 (function() { var a = b = 5; })(); console.log(b); what will be printed on the console?
To write messages to the screen without using "document.write()"?
How you can modify XAML content from JavaScript in Silverlight?
Do hackers use javascript?