Difference between a multi-dimensional array and nested array

Hi guys, I’m doing JavaScript course and I’m a little confused about these concepts. What’s the difference between a multi-dimensional array and a nested array?

1 Like

Can you give an example of what you mean? Javascript implements multi-dimensional arrays as nested arrays, AFAIK.

Currently I’m doing this challenge:

Until this, I thought that any array inside an array was called “multi-dimensional array”, but the concept “nested” apparently refers to the same thing. So which is it? Are they the same thing perhaps?

Yeah, a multi-dimensional array is an ‘array of arrays’ which is an example of nested arrays. In this case, you have an array of objects, and one of the object properties is itself an array.

1 Like

You’ll see terms like “multi-dimensional array”, “jagged array”, “nested array”, and “n-dimensional array” used semi-interchangeably. You might encounter people who refer to the parent array as “multi-dimensional” and then the array elements as “nested arrays” or “sub-arrays”. Programming jargon is very amorphous .

2 Likes