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:
Hassaan Pasha
2020-02-05 03:00:33 +05:00
committed by GitHub
parent 9a863898f3
commit d89eae392f

View File

@ -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>