2020-09-29 22:09:05 +02:00

1.1 KiB

id, title, challengeType, videoUrl, forumTopicId, localeTitle
id title challengeType videoUrl forumTopicId localeTitle
cf1111c1c11feddfaeb7bdef Nest one Array within Another Array 1 https://scrimba.com/c/crZQZf8 18247 将一个数组嵌套在另一个数组中

Description

你也可以在数组中包含其他数组,例如:[["Bulls", 23], ["White Sox", 45]]。这被称为一个多维数组

Instructions

创建一个名为myArray的多维数组。

Tests

tests:
  - text: 应该包含至少一个嵌入的数组。
    testString: assert(Array.isArray(myArray) && myArray.some(Array.isArray));

Challenge Seed

// Example
var ourArray = [["the universe", 42], ["everything", 101010]];

// Only change code below this line.
var myArray = [];

After Test

if(typeof myArray !== "undefined"){(function(){return myArray;})();}

Solution

var myArray = [[1,2,3]];