Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

accessdenied javanet disconnet

2205


Which keywords are used to handle exceptions?

1012


What is variable typing?

1108


Explain a story about javascript performance problems?

986


How to setting a cookie with the contents of a textbox?

1048


Write a program to exaplain the deferred scripts using event handlers in javascript.

946


What are the different functional component in javascript?

969


What are the ways of making comments in javascript?

910


Explain higher-order functions in javascript?

964


How typeof operator works?

1085


What boolean operators can be used in JavaScript?

1066


what is function of stdio.h

2543


How to reload a page using JavaScript?

1292


How can you create an Array in JavaScript?

1086


What do “1”+2+4 evaluate to?

1004