Randell Dawson e0e6334628
fix(curriculum): Consolidated comments for JavaScript Algorithms and Data Structures challenges - part 3 of 4 (#38264)
* fix: remove example code from challenge seed

* fix: remove declaration from solution

* fix: added sum variable back in

* fix: reverted description back to original version

* fix: added examples to description section

* fix: added complete sentence

Co-Authored-By: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>

* fix: corrected typo

Co-Authored-By: Manish Giri <manish.giri.me@gmail.com>

* fix: reverted to original desc with formatted code

* fix: removed unnecessary code example from description section

Co-Authored-By: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>

* fix: failiing test on iterate through array with for loop

* fix: changed to Only change this line

Co-Authored-By: Manish Giri <manish.giri.me@gmail.com>

Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
Co-authored-by: Manish Giri <manish.giri.me@gmail.com>
Co-authored-by: moT01 <tmondloch01@gmail.com>
2020-03-25 16:07:13 +01:00

1.1 KiB

id, title, challengeType, videoUrl, forumTopicId
id title challengeType videoUrl forumTopicId
cf1111c1c11feddfaeb7bdef Nest one Array within Another Array 1 https://scrimba.com/c/crZQZf8 18247

Description

You can also nest arrays within other arrays, like below:
[["Bulls", 23], ["White Sox", 45]]

This is also called a multi-dimensional array.

Instructions

Create a nested array called myArray.

Tests

tests:
  - text: <code>myArray</code> should have at least one array nested within another array.
    testString: assert(Array.isArray(myArray) && myArray.some(Array.isArray));

Challenge Seed

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

After Test

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

Solution

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