freeCodeCamp/guide/english/certifications/javascript-algorithms-and-d.../basic-javascript/nest-one-array-within-anoth.../index.md

14 lines
487 B
Markdown
Raw Normal View History

2018-10-12 19:37:13 +00:00
---
title: Nest one Array within Another Array
---
## Nest one Array within Another Array
<!-- The article goes here, in GitHub-flavored Markdown. Feel free to add YouTube videos, images, and CodePen/JSBin embeds -->
Arrays are one-dimensional; that means they store only one row of data. But you can make an array multi-dimensional by putting arrays inside arrays! Like so:
```javascript
var arr = [["Two-dimensional", 2], ["Two rows", 12]];
```
The above array has two dimensions.