From 9a9cef38bd8b5ea14deaca4c8ae10d3d4012debd Mon Sep 17 00:00:00 2001 From: Abhishek Sharma Date: Wed, 3 Aug 2022 21:59:04 +0530 Subject: [PATCH] fix(curriculum): updated JS debugging challenge run-test (#47139) --- .../debugging/catch-off-by-one-errors-when-using-indexing.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/debugging/catch-off-by-one-errors-when-using-indexing.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/debugging/catch-off-by-one-errors-when-using-indexing.md index 1b226965967..e0ccc7ba4d2 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/debugging/catch-off-by-one-errors-when-using-indexing.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/debugging/catch-off-by-one-errors-when-using-indexing.md @@ -49,7 +49,7 @@ assert(!code.match(/i\s?=\s*?1\s*?;/g)); Your code should set the terminal condition of the loop so it stops at the last index. ```js -assert(code.match(/i\s*?<\s*?len\s*?;/g).length == 1); +assert(code.match(/i\s*<\s*len\s*;|i\s*<=\s*len\s*-\s*1\s*;/g).length == 1); ``` Your code should fix the terminal condition of the loop so that it stops at 1 before the length.