Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript JavaScript Loops, Arrays and Objects Tracking Data Using Objects Review Loops, Arrays, and Objects

lagah rajan
lagah rajan
1,741 Points

2-d array is an array of objects. i think it is true as [1,2,3].length is explained by saying [1,2,3] is object

so array may also be a object. So array of array is same as array of object . so this may b true. am i correct ?

1 Answer

Jennifer Nordell
seal-mask
STAFF
.a{fill-rule:evenodd;}techdegree
Jennifer Nordell
Treehouse Teacher

You are correct! An array in JavaScript is an object.

Here's the first line from the documentation on arrays from MDN.

The JavaScript Array object is a global object that is used in the construction of arrays; which are high-level, list-like objects.

Good luck! :sparkles:

lagah rajan
lagah rajan
1,741 Points

thanku mam; actually that is the question in quiz. 2-d array is an array of objects(true/false) with right ans false. so may be it can b change and set true to its right ans (if u feel it or tell me if i am wrong in understanding that question); thanku..

Jennifer Nordell
seal-mask
.a{fill-rule:evenodd;}techdegree
Jennifer Nordell
Treehouse Teacher

I'm not Treehouse staff. If you believe this question to be improperly worded then you should contact support with a suggestion. However, given the context, I believe what they meant here was that a multidimensional array is an array of arrays. Array is a specific kind of object.

So in this case, then yes, a multidimensional array is specifically an array (which is a specific kind of object) of arrays (which is again a specific kind of object). A String is also a global object. But a multidimensional array is not an array of String objects. It is specifically an array of arrays. Hope that helps! :sparkles:

lagah rajan
lagah rajan
1,741 Points

ok that is awesome explanation, thanku mam.