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.