fix: recursion test (#37419)
* fix(challenge): recursion test * fix(challenge): replace regex s flag with g
This commit is contained in:
		| @@ -57,7 +57,7 @@ tests: | |||||||
|   - text: Your code should not rely on any kind of loops (<code>for</code> or <code>while</code> or higher order functions such as <code>forEach</code>, <code>map</code>, <code>filter</code>, or <code>reduce</code>.). |   - text: Your code should not rely on any kind of loops (<code>for</code> or <code>while</code> or higher order functions such as <code>forEach</code>, <code>map</code>, <code>filter</code>, or <code>reduce</code>.). | ||||||
|     testString: assert(!removeJSComments(code).match(/for|while|forEach|map|filter|reduce/g)); |     testString: assert(!removeJSComments(code).match(/for|while|forEach|map|filter|reduce/g)); | ||||||
|   - text: You should use recursion to solve this problem. |   - text: You should use recursion to solve this problem. | ||||||
|     testString: assert(removeJSComments(sum.toString()).match(/sum\(.*\).*\{.*sum\(.*\).*\}/s)); |     testString: assert(removeJSComments(sum.toString()).match(/sum\(.*\)/g).length > 1); | ||||||
| ``` | ``` | ||||||
|  |  | ||||||
| </section> | </section> | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user