FIX: "ReferenceError: arr is not defined"

Line 265 and 266: Use 'fruits' instead of the 'arr' variable.
This commit is contained in:
Shanelle Marasigan 2022-08-08 09:30:47 +08:00 committed by GitHub
parent 7000ede297
commit 35e2ed25c8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -262,8 +262,8 @@ The method [arr.lastIndexOf](mdn:js/Array/lastIndexOf) is the same as `indexOf`,
```js run
let fruits = ['Apple', 'Orange', 'Apple']
alert( arr.indexOf('Apple') ); // 0 (first Apple)
alert( arr.lastIndexOf('Apple') ); // 2 (last Apple)
alert( fruits.indexOf('Apple') ); // 0 (first Apple)
alert( fruits.lastIndexOf('Apple') ); // 2 (last Apple)
```
````smart header="The `includes` method handles `NaN` correctly"