Back to Freecodecamp

Nest one Array within Another Array

curriculum/challenges/english/blocks/basic-javascript/cf1111c1c11feddfaeb7bdef.md

latest573 B
Original Source

--description--

You can also nest arrays within other arrays, like below:

js
const teams = [["Bulls", 23], ["White Sox", 45]];

This is also called a <dfn>multi-dimensional array</dfn>.

--instructions--

Create a nested array called myArray.

--hints--

myArray should have at least one array nested within another array.

js
assert(Array.isArray(myArray) && myArray.some(Array.isArray));

--seed--

--seed-contents--

js
// Only change code below this line
const myArray = [];

--solutions--

js
const myArray = [[1, 2, 3]];