concat method.
testString: assert(code.match(/\.concat/g));
- text: Your code should not use the push method.
- testString: assert(!code.match(/\.push/g));
+ testString: assert(!code.match(/\.?[\s\S]*?push/g));
- text: The first array should not change.
testString: assert(JSON.stringify(first) === JSON.stringify([1, 2, 3]));
- text: The second array should not change.
diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/functional-programming/apply-functional-programming-to-convert-strings-to-url-slugs.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/functional-programming/apply-functional-programming-to-convert-strings-to-url-slugs.english.md
index 3bcebd0a81f..eb87a3490f8 100644
--- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/functional-programming/apply-functional-programming-to-convert-strings-to-url-slugs.english.md
+++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/functional-programming/apply-functional-programming-to-convert-strings-to-url-slugs.english.md
@@ -29,7 +29,7 @@ tests:
- text: The globalTitle variable should not change.
testString: assert(globalTitle === "Winter Is Coming");
- text: Your code should not use the replace method for this challenge.
- testString: assert(!code.match(/\.replace/g));
+ testString: assert(!code.match(/\.?[\s\S]*?replace/g));
- text: urlSlug("Winter Is Coming") should return "winter-is-coming".
testString: assert(urlSlug("Winter Is Coming") === "winter-is-coming");
- text: urlSlug(" Winter Is Coming") should return "winter-is-coming".
diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/functional-programming/combine-an-array-into-a-string-using-the-join-method.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/functional-programming/combine-an-array-into-a-string-using-the-join-method.english.md
index d94bb3c41cf..ee7afe2378a 100644
--- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/functional-programming/combine-an-array-into-a-string-using-the-join-method.english.md
+++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/functional-programming/combine-an-array-into-a-string-using-the-join-method.english.md
@@ -31,7 +31,7 @@ tests:
- text: Your code should use the join method.
testString: assert(code.match(/\.join/g));
- text: Your code should not use the replace method.
- testString: assert(!code.match(/\.replace/g));
+ testString: assert(!code.match(/\.?[\s\S]*?replace/g));
- text: sentensify("May-the-force-be-with-you") should return a string.
testString: assert(typeof sentensify("May-the-force-be-with-you") === "string");
- text: sentensify("May-the-force-be-with-you") should return "May the force be with you".
diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/functional-programming/implement-map-on-a-prototype.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/functional-programming/implement-map-on-a-prototype.english.md
index b0589dc2e84..a3bbaf18554 100644
--- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/functional-programming/implement-map-on-a-prototype.english.md
+++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/functional-programming/implement-map-on-a-prototype.english.md
@@ -26,7 +26,7 @@ tests:
- text: new_s should equal [46, 130, 196, 10].
testString: assert(JSON.stringify(new_s) === JSON.stringify([46, 130, 196, 10]));
- text: Your code should not use the map method.
- testString: assert(!code.match(/\.map/g));
+ testString: assert(!code.match(/\.?[\s\S]*?map/g));
```
diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/functional-programming/implement-the-filter-method-on-a-prototype.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/functional-programming/implement-the-filter-method-on-a-prototype.english.md
index 71322708860..d26c2961f1c 100644
--- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/functional-programming/implement-the-filter-method-on-a-prototype.english.md
+++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/functional-programming/implement-the-filter-method-on-a-prototype.english.md
@@ -24,7 +24,7 @@ tests:
- text: new_s should equal [23, 65, 5].
testString: assert(JSON.stringify(new_s) === JSON.stringify([23, 65, 5]));
- text: Your code should not use the filter method.
- testString: assert(!code.match(/\.filter/g));
+ testString: assert(!code.match(/\.?[\s\S]*?filter/g));
```
diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/functional-programming/remove-elements-from-an-array-using-slice-instead-of-splice.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/functional-programming/remove-elements-from-an-array-using-slice-instead-of-splice.english.md
index 3d06097ed3c..d3b5e3ffd16 100644
--- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/functional-programming/remove-elements-from-an-array-using-slice-instead-of-splice.english.md
+++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/functional-programming/remove-elements-from-an-array-using-slice-instead-of-splice.english.md
@@ -32,7 +32,7 @@ tests:
- text: Your code should use the slice method.
testString: assert(code.match(/\.slice/g));
- text: Your code should not use the splice method.
- testString: assert(!code.match(/\.splice/g));
+ testString: assert(!code.match(/\.?[\s\S]*?splice/g));
- text: The inputCities array should not change.
testString: assert(JSON.stringify(inputCities) === JSON.stringify(["Chicago", "Delhi", "Islamabad", "London", "Berlin"]));
- text: nonMutatingSplice(["Chicago", "Delhi", "Islamabad", "London", "Berlin"]) should return ["Chicago", "Delhi", "Islamabad"].
diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/steamroller.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/steamroller.english.md
index fc698e38b27..fa0d52c18bf 100644
--- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/steamroller.english.md
+++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/steamroller.english.md
@@ -7,16 +7,19 @@ forumTopicId: 16079
---
## Description
+
steamrollArray([1, {}, [3, [[4]]]]) should return [1, {}, 3, 4].
testString: assert.deepEqual(steamrollArray([1, {}, [3, [[4]]]]), [1, {}, 3, 4]);
- text: Your solution should not use the Array.prototype.flat() or Array.prototype.flatMap() methods.
- testString: assert(!code.match(/\.flat\([\s\S]*?\)/) && !code.match(/\.flatMap\([\s\S]*?\)/));
+ testString: assert(!code.match(/\.?[\s\S]*?flat/) && !code.match(/\.?[\s\S]*?flatMap/));
```
result should equal to "Hello, World!"
testString: assert(result == "Hello, World!");
- text: Your solution should not use the String.prototype.trim() method.
- testString: assert(!code.match(/\.trim\([\s\S]*?\)/));
+ testString: assert(!code.match(/\.?[\s\S]*?trim/));
- text: The result variable should not be set equal to a string.
testString: assert(!code.match(/result\s*=\s*".*?"/));
diff --git a/curriculum/challenges/english/08-coding-interview-prep/algorithms/implement-bubble-sort.english.md b/curriculum/challenges/english/08-coding-interview-prep/algorithms/implement-bubble-sort.english.md
index 3ba8ea0a7f0..36fc5101be0 100644
--- a/curriculum/challenges/english/08-coding-interview-prep/algorithms/implement-bubble-sort.english.md
+++ b/curriculum/challenges/english/08-coding-interview-prep/algorithms/implement-bubble-sort.english.md
@@ -31,7 +31,7 @@ tests:
- text: bubbleSort should return an array that is unchanged except for order.
testString: assert.sameMembers(bubbleSort([1,4,2,8,345,123,43,32,5643,63,123,43,2,55,1,234,92]), [1,4,2,8,345,123,43,32,5643,63,123,43,2,55,1,234,92]);
- text: bubbleSort should not use the built-in .sort() method.
- testString: assert.strictEqual(code.search(/\.sort\(/), -1);
+ testString: assert(!code.match(/\.?[\s\S]*?sort/));
```
diff --git a/curriculum/challenges/english/08-coding-interview-prep/algorithms/implement-insertion-sort.english.md b/curriculum/challenges/english/08-coding-interview-prep/algorithms/implement-insertion-sort.english.md
index 004af423550..6bfce6b5307 100644
--- a/curriculum/challenges/english/08-coding-interview-prep/algorithms/implement-insertion-sort.english.md
+++ b/curriculum/challenges/english/08-coding-interview-prep/algorithms/implement-insertion-sort.english.md
@@ -29,7 +29,7 @@ tests:
- text: insertionSort should return an array that is unchanged except for order.
testString: assert.sameMembers(insertionSort([1,4,2,8,345,123,43,32,5643,63,123,43,2,55,1,234,92]), [1,4,2,8,345,123,43,32,5643,63,123,43,2,55,1,234,92]);
- text: insertionSort should not use the built-in .sort() method.
- testString: assert.strictEqual(code.search(/\.sort\(/), -1);
+ testString: assert(!code.match(/\.?[\s\S]*?sort/));
```
diff --git a/curriculum/challenges/english/08-coding-interview-prep/algorithms/implement-merge-sort.english.md b/curriculum/challenges/english/08-coding-interview-prep/algorithms/implement-merge-sort.english.md
index 8fd7f7a0be7..df2bda05c58 100644
--- a/curriculum/challenges/english/08-coding-interview-prep/algorithms/implement-merge-sort.english.md
+++ b/curriculum/challenges/english/08-coding-interview-prep/algorithms/implement-merge-sort.english.md
@@ -33,7 +33,7 @@ tests:
- text: mergeSort should return an array that is unchanged except for order.
testString: assert.sameMembers(mergeSort([1,4,2,8,345,123,43,32,5643,63,123,43,2,55,1,234,92]), [1,4,2,8,345,123,43,32,5643,63,123,43,2,55,1,234,92]);
- text: mergeSort should not use the built-in .sort() method.
- testString: assert.strictEqual(code.search(/\.sort\(/), -1);
+ testString: assert(!code.match(/\.?[\s\S]*?sort/));
```
diff --git a/curriculum/challenges/english/08-coding-interview-prep/algorithms/implement-quick-sort.english.md b/curriculum/challenges/english/08-coding-interview-prep/algorithms/implement-quick-sort.english.md
index 23b8a301043..babda81e111 100644
--- a/curriculum/challenges/english/08-coding-interview-prep/algorithms/implement-quick-sort.english.md
+++ b/curriculum/challenges/english/08-coding-interview-prep/algorithms/implement-quick-sort.english.md
@@ -30,7 +30,7 @@ tests:
- text: quickSort should return an array that is unchanged except for order.
testString: assert.sameMembers(quickSort([1,4,2,8,345,123,43,32,5643,63,123,43,2,55,1,234,92]), [1,4,2,8,345,123,43,32,5643,63,123,43,2,55,1,234,92]);
- text: quickSort should not use the built-in .sort() method.
- testString: assert.strictEqual(code.search(/\.sort\(/), -1);
+ testString: assert(!code.match(/\.?[\s\S]*?sort/));
```
diff --git a/curriculum/challenges/english/08-coding-interview-prep/algorithms/implement-selection-sort.english.md b/curriculum/challenges/english/08-coding-interview-prep/algorithms/implement-selection-sort.english.md
index 773f93ff705..67d552b70ed 100644
--- a/curriculum/challenges/english/08-coding-interview-prep/algorithms/implement-selection-sort.english.md
+++ b/curriculum/challenges/english/08-coding-interview-prep/algorithms/implement-selection-sort.english.md
@@ -29,7 +29,7 @@ tests:
- text: selectionSort should return an array that is unchanged except for order.
testString: assert.sameMembers(selectionSort([1,4,2,8,345,123,43,32,5643,63,123,43,2,55,1,234,92]), [1,4,2,8,345,123,43,32,5643,63,123,43,2,55,1,234,92]);
- text: selectionSort should not use the built-in .sort() method.
- testString: assert.strictEqual(code.search(/\.sort\(/), -1);
+ testString: assert(!code.match(/\.?[\s\S]*?sort/));
```