Edit: sorry, same as #38491
Describe your problem and how to reproduce it:
The fifth test for Steamroller algorithm fails for function names containing flat
Your solution should not use the
Array.prototype.flat()orArray.prototype.flatMap()methods.
const flatten = array => { } // this will fail the fifth test
function steamrollArray(arr) {
return arr; // even without the function call
}
Add a Link to the page with the problem:
Intermediate Algorithm Scripting: Steamroller
Tell us about your browser and operating system:
If possible, add a screenshot here (you can drag and drop, png, jpg, gif, etc. in this box):

@piouson, awesome, great catch here. The issue seems to be with this testString, which is a bit too flexible:
testString: assert(!code.match(/\.?[\s\S]*?flat/) && !code.match(/\.?[\s\S]*?flatMap/));
For some reason . characters before flat or flatMap are optional. This could be changed to ensure that we're only catching those array methods, not other variables, functions, or even comments that include "flat".
My bad @scissorsneedfoodtoo same as #38491 and #38497
@piouson, ah, I didn't notice those other ones. Thanks for bringing this up, though! It's definitely something we want to fix.