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

Is javascript case sensitive language?

1025


What are global variables in javascript?

1034


What is the difference between script type and the script language attributes?

947


How do I save javascript?

967


What is the default scope in javascript?

885


How do I open a website code?

1049


What are different types of popup boxes available in javascript?

969


How do you write an if statement in javascript?

928


What is the difference between sessionstate and viewstate?

939


Which javascript is best?

952


How to write a hello world example of javascript?

941


What does double mean in javascript?

1137


What is the main difference between Map collections and other collections such as Set.

3041


What is npm javascript?

963


How can I set up my own javascript error handler?

929