From 35e2ed25c81135a968ca32f3a18fd50aa7cdfde2 Mon Sep 17 00:00:00 2001 From: Shanelle Marasigan <39988782+rmarasigan@users.noreply.github.com> Date: Mon, 8 Aug 2022 09:30:47 +0800 Subject: [PATCH] FIX: "ReferenceError: arr is not defined" Line 265 and 266: Use 'fruits' instead of the 'arr' variable. --- 1-js/05-data-types/05-array-methods/article.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/1-js/05-data-types/05-array-methods/article.md b/1-js/05-data-types/05-array-methods/article.md index 10409378..feb626f9 100644 --- a/1-js/05-data-types/05-array-methods/article.md +++ b/1-js/05-data-types/05-array-methods/article.md @@ -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"