diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-data-structures/remove-items-using-splice.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-data-structures/remove-items-using-splice.english.md
index 52f1dcf81f..d0e81d43fe 100644
--- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-data-structures/remove-items-using-splice.english.md
+++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-data-structures/remove-items-using-splice.english.md
@@ -31,7 +31,9 @@ let newArray = array.splice(3, 2);
## Instructions
sumOfTen
, which takes an array as an argument and returns the sum of that array's elements. Modify the function, using splice()
, so that it returns a value of 10
.
+
+We've initialized an array `arr`. Use `splice()` to remove elements from `arr`, so that it only contains elements that sum to the value of 10
.
+
sumOfTen
, which takes an array as an argu
```yml
tests:
- - text: sumOfTen
should return 10
- testString: assert.strictEqual(sumOfTen([2, 5, 1, 5, 2, 1]), 10);
- - text: The sumOfTen
function should utilize the splice()
method
- testString: assert.notStrictEqual(sumOfTen.toString().search(/\.splice\(/), -1);
-
+ - text: You should not change the original line of const arr = [2, 4, 5, 1, 7, 5, 2, 1];
.
+ testString: assert(code.replace(/\s/g, '').match(/constarr=\[2,4,5,1,7,5,2,1\];?/));
+ - text: arr
should only contain elements that sum to 10
.
+ testString: assert.strictEqual(arr.reduce((a, b) => a + b), 10);
+ - text: Your code should utilize the splice()
method on arr
.
+ testString: assert(code.replace(/\s/g, '').match(/arr\.splice\(/));
+ - text: The splice should only remove elements from arr
and not add any additional elements to arr
.
+ testString: assert(!code.replace(/\s/g, '').match(/arr\.splice\(\d+,\d+,\d+.*\)/g));
```
@@ -54,15 +59,11 @@ tests: