2021-06-15 03:34:20 +09:00
|
|
|
---
|
|
|
|
id: cf1111c1c11feddfaeb7bdef
|
|
|
|
title: Nidificare un array in un altro array
|
|
|
|
challengeType: 1
|
|
|
|
videoUrl: 'https://scrimba.com/c/crZQZf8'
|
|
|
|
forumTopicId: 18247
|
|
|
|
dashedName: nest-one-array-within-another-array
|
|
|
|
---
|
|
|
|
|
|
|
|
# --description--
|
|
|
|
|
|
|
|
È anche possibile nidificare array all'interno di altri array, come nell'esempio:
|
|
|
|
|
|
|
|
```js
|
2021-10-27 15:10:57 +00:00
|
|
|
const teams = [["Bulls", 23], ["White Sox", 45]];
|
2021-06-15 03:34:20 +09:00
|
|
|
```
|
|
|
|
|
|
|
|
Questo viene anche chiamato un <dfn>array multidimensionale</dfn>.
|
|
|
|
|
|
|
|
# --instructions--
|
|
|
|
|
|
|
|
Crea un array annidato chiamato `myArray`.
|
|
|
|
|
|
|
|
# --hints--
|
|
|
|
|
|
|
|
`myArray` dovrebbe avere almeno un array annidato all'interno di un altro array.
|
|
|
|
|
|
|
|
```js
|
|
|
|
assert(Array.isArray(myArray) && myArray.some(Array.isArray));
|
|
|
|
```
|
|
|
|
|
|
|
|
# --seed--
|
|
|
|
|
|
|
|
## --after-user-code--
|
|
|
|
|
|
|
|
```js
|
|
|
|
if(typeof myArray !== "undefined"){(function(){return myArray;})();}
|
|
|
|
```
|
|
|
|
|
|
|
|
## --seed-contents--
|
|
|
|
|
|
|
|
```js
|
|
|
|
// Only change code below this line
|
2021-10-27 15:10:57 +00:00
|
|
|
const myArray = [];
|
2021-06-15 03:34:20 +09:00
|
|
|
```
|
|
|
|
|
|
|
|
# --solutions--
|
|
|
|
|
|
|
|
```js
|
2021-10-27 15:10:57 +00:00
|
|
|
const myArray = [[1, 2, 3]];
|
2021-06-15 03:34:20 +09:00
|
|
|
```
|