fix: adding test to check if flat or flatMap method was used in the steamroller challenge (#38158)
* fix: adding test to check if flat or flatMap method was used in the steamroller challenge * Addressed comments and acknowledged suggestions
This commit is contained in:
@ -30,7 +30,8 @@ tests:
|
||||
testString: assert.deepEqual(steamrollArray([1, [], [3, [[4]]]]), [1, 3, 4]);
|
||||
- text: <code>steamrollArray([1, {}, [3, [[4]]]])</code> should return <code>[1, {}, 3, 4]</code>.
|
||||
testString: assert.deepEqual(steamrollArray([1, {}, [3, [[4]]]]), [1, {}, 3, 4]);
|
||||
|
||||
- text: Your solution should not use the <code>Array.prototype.flat()</code> or <code>Array.prototype.flatMap()</code> methods.
|
||||
testString: assert(!code.match(/\.flat\([\s\S]*?\)/) && !code.match(/\.flatMap\([\s\S]*?\)/));
|
||||
```
|
||||
|
||||
</section>
|
||||
|
Reference in New Issue
Block a user