fix(curriculum): clear up confusion of array index (#45576)

pull/45576/merge
Suph 2022-03-30 11:45:20 -07:00 committed by GitHub
parent 7fef4346a4
commit 405675261d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -19,11 +19,11 @@ Array indexes are written in the same bracket notation that strings use, except
```js
const array = [50, 60, 70];
array[0];
console.log(array[0]);
const data = array[1];
```
`array[0]` is now `50`, and `data` has the value `60`.
The `console.log(array[0])` prints `50`, and `data` has the value `60`.
**Note:** There shouldn't be any spaces between the array name and the square brackets, like `array [0]`. Although JavaScript is able to process this correctly, this may confuse other programmers reading your code.