steamrollArray([[["a"]], [["b"]]])
should return ["a", "b"]
.
testString: assert.deepEqual(steamrollArray([[["a"]], [["b"]]]), ["a", "b"]);
- text: steamrollArray([1, [2], [3, [[4]]]])
should return [1, 2, 3, 4]
.
testString: assert.deepEqual(steamrollArray([1, [2], [3, [[4]]]]), [1, 2, 3, 4]);
- text: steamrollArray([1, [], [3, [[4]]]])
should return [1, 3, 4]
.
testString: assert.deepEqual(steamrollArray([1, [], [3, [[4]]]]), [1, 3, 4]);
- text: 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(/\.\s*flat\s*\(/) && !code.match(/\.\s*flatMap\s*\(/));
```