How can I define an array in JavaScript?
Answer Posted / 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 |
Post New Answer View All Answers
accessdenied javanet disconnet
Which keywords are used to handle exceptions?
What is variable typing?
Explain a story about javascript performance problems?
How to setting a cookie with the contents of a textbox?
Write a program to exaplain the deferred scripts using event handlers in javascript.
What are the different functional component in javascript?
What are the ways of making comments in javascript?
Explain higher-order functions in javascript?
How typeof operator works?
What boolean operators can be used in JavaScript?
what is function of stdio.h
How to reload a page using JavaScript?
How can you create an Array in JavaScript?
What do “1”+2+4 evaluate to?