dcsimg
Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX

By submitting your information, you agree that devx.com may send you DevX offers via email, phone and text message, as well as email offers about other products and services that DevX believes may be of interest to you. DevX will process your information in accordance with the Quinstreet Privacy Policy.


Tip of the Day
Language:
Expertise: Beginner
Aug 11, 2000

WEBINAR:

On-Demand

Building the Right Environment to Support AI, Machine Learning and Deep Learning


Multi-dimensional Arrays

Question:
Can I create multi-dimensional arrays in JavaScript? Do you have an example?

Answer:
Yes and no.

You can't create multi-dimensional arrays (as such) in JavaScript. What you can do is create an array of arrays, though. For instance, you can have:

numberArray = new Array("one","two","three")
letterArray = new Array("a","b","c")
bigArray = new Array(numberArray,letterArray)
You could later reference bigArray[0][1], which would be "b" (arrays are zero-relative).
DevX Pro
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap
Thanks for your registration, follow us on our social networks to keep up-to-date