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

What is dhtml in javascript?

868


How can I prevent others from reading/stealing my scripts or images?

861


How to have the status line update when the mouse goes over a link (the support of the status line is sporadic)?

912


What is differential inheritance?

913


How do you reverse a string in javascript?

855


what is flux in javascript?

1002


Is array an object javascript?

886


What are the limitations of javascript?

900


Do you need to declare variables in javascript?

872


How to get complete current page url with javascript?

885


How Does Function Hoisting Work in JavaScript?

884


How to make elements invisible?

1075


Can you explain about screen object?

912


What is the difference between the substr() and substring() functions in javascript?

933


What are different types of popup boxes available in javascript?

912