From ae0d34359a966a370bb7d7632caaa3f56c2382ad Mon Sep 17 00:00:00 2001 From: awu43 <46470763+awu43@users.noreply.github.com> Date: Tue, 15 Jun 2021 08:35:35 -0700 Subject: [PATCH] fix(curriculum): stop false positives in test for array hard coding (#42461) * Fixed test regex to avoid false matches * Changed regex to only match values in globalArray * Revert non-English changes --- ...return-a-sorted-array-without-changing-the-original-array.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/functional-programming/return-a-sorted-array-without-changing-the-original-array.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/functional-programming/return-a-sorted-array-without-changing-the-original-array.md index 6a04216752..ab1f85159f 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/functional-programming/return-a-sorted-array-without-changing-the-original-array.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/functional-programming/return-a-sorted-array-without-changing-the-original-array.md @@ -40,7 +40,7 @@ assert( `nonMutatingSort(globalArray)` should not be hard coded. ```js -assert(!nonMutatingSort.toString().match(/[23569]/g)); +assert(!nonMutatingSort.toString().match(/\[.*?[23569].*?\]/gs)); ``` The function should return a new array, not the array passed to it.