Get the Grasshopper Explainer

Aim of the puzzle: Use array indexing to access an item in a nested array.

Walk through of the solution: Array indexing with a nested array requires 2 indices, for example nestedArray[1][0].

The 1st index accesses the inner array. The 2nd index accesses the item inside that inner array. For example, nestedArray[1][0] selects the first item from the second inner array.

To complete the puzzle, change the item inside the parentheses of console.log() from bugs[2][0] to bugs[1][1].

Sample code solution:

let bugs = [
  ['bee', 'ant'],
  ['cricket', 'grasshopper'],
  ['ladybug', 'mantis'],
];

console.log(bugs[1][1])

JavaScript concepts: Variables, Strings, Nested Arrays, Array Indexing