Skip to content

Commit 35e2ed2

Browse files
authored
FIX: "ReferenceError: arr is not defined"
Line 265 and 266: Use 'fruits' instead of the 'arr' variable.
1 parent 7000ede commit 35e2ed2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

1-js/05-data-types/05-array-methods/article.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -262,8 +262,8 @@ The method [arr.lastIndexOf](mdn:js/Array/lastIndexOf) is the same as `indexOf`,
262262
```js run
263263
let fruits = ['Apple', 'Orange', 'Apple']
264264

265-
alert( arr.indexOf('Apple') ); // 0 (first Apple)
266-
alert( arr.lastIndexOf('Apple') ); // 2 (last Apple)
265+
alert( fruits.indexOf('Apple') ); // 0 (first Apple)
266+
alert( fruits.lastIndexOf('Apple') ); // 2 (last Apple)
267267
```
268268

269269
````smart header="The `includes` method handles `NaN` correctly"

0 commit comments

Comments
 (0)