WARNING

Are you sure you want to reset the challenge? You'll lose all changes you've made to the code.

Array Indexes

Arrays are ordered lists. We can get a value at a specific position in the list using an index. Just like strings, array indexes start at 0. If you ask for an out-of-range index, the result will be undefined.

Here's an example:

let list = ["some string", 42, true];
list[0]; // 'some string'
list[1]; // 42
list[2]; // true
list[3]; // undefined

Tests

To pass the tests, create a variable called testArray. It should:

(WARNING: the following values are not in order)

  • at the second index: the number 42
  • at the third index: the string "hello"
  • at the zeroth index: the boolean true
  • at the first index: undefined (undefined is a value)