diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/access-multi-dimensional-arrays-with-indexes.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/access-multi-dimensional-arrays-with-indexes.md index b604556a4df..a9f81ecd7df 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/access-multi-dimensional-arrays-with-indexes.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/access-multi-dimensional-arrays-with-indexes.md @@ -21,12 +21,13 @@ const arr = [ [[10, 11, 12], 13, 14] ]; -arr[3]; -arr[3][0]; -arr[3][0][1]; +const subarray = arr[3]; +const nestedSubarray = arr[3][0]; +const element = arr[3][0][1]; ``` -`arr[3]` is `[[10, 11, 12], 13, 14]`, `arr[3][0]` is `[10, 11, 12]`, and `arr[3][0][1]` is `11`. +In this example, `subarray` has the value `[[10, 11, 12], 13, 14]`, +`nestedSubarray` has the value `[10, 11, 12]`, and `element` has the value `11` . **Note:** There shouldn't be any spaces between the array name and the square brackets, like `array [0][0]` and even this `array [0] [0]` is not allowed. Although JavaScript is able to process this correctly, this may confuse other programmers reading your code.