From a34921a5b3d19218bb844000b3a76328cf388161 Mon Sep 17 00:00:00 2001 From: Julius Lee <71372051+julschong@users.noreply.github.com> Date: Mon, 2 Aug 2021 10:37:50 -0700 Subject: [PATCH] fix(curriculum): add additional test case to fix hard code issue (#43086) * fix: added additional matrix1 test case for different arguments to fix hard code issue #43050 * fix: reduced additional test case to only 1 with zeroArray(4,3) and added to all languages * Revert "fix: reduced additional test case to only 1 with zeroArray(4,3) and added to all languages" This reverts commit bbbb1c7cbcc1c81283c854e602753d6ccafd8540. * fix: only simplify and reduce to 1 test case using zeroArray(4,3), reverted internationalization * fix: removed unused matrix1 from seed and solution * update: for better wording of the added test case suggested Co-authored-by: gikf <60067306+gikf@users.noreply.github.com> Co-authored-by: gikf <60067306+gikf@users.noreply.github.com> --- ...caution-when-reinitializing-variables-inside-a-loop.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/debugging/use-caution-when-reinitializing-variables-inside-a-loop.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/debugging/use-caution-when-reinitializing-variables-inside-a-loop.md index 19dd59b605..2f94f0bcfe 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/debugging/use-caution-when-reinitializing-variables-inside-a-loop.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/debugging/use-caution-when-reinitializing-variables-inside-a-loop.md @@ -38,6 +38,12 @@ assert( ); ``` +`zeroArray(4,3)` should return an array holding 4 rows of 3 columns of zeroes each. + +```js +assert(JSON.stringify(zeroArray(4,3)) == '[[0,0,0],[0,0,0],[0,0,0],[0,0,0]]'); +``` + # --seed-- ## --seed-contents-- @@ -62,6 +68,7 @@ function zeroArray(m, n) { let matrix = zeroArray(3, 2); console.log(matrix); + ``` # --solutions-- @@ -86,4 +93,5 @@ function zeroArray(m, n) { let matrix = zeroArray(3, 2); console.log(matrix); + ```