Steamroller Array.prototype.flat() error

Hi everyone,
After copying the results for many many challenges I finally finished one by my self :sweat_smile: :joy:, but the test says I used Array.prototype.flat()
I didn’t use it.

My Code
Warning You May Lose Brain Cells

function steamrollArray(arr) {
  let flat = [];
  for(let i = 0; i < arr.length; i++){
    isArr(arr[i]);
  }
  function isArr (item) {
      if(Array.isArray(item)){
        for(let j = 0; j < item.length; j++){
          isArr(item[j]);
        }
      } else {
        flat.push(item);
      }
    }
  return flat;
}

Renaming array flat to something not including “flat” in it, should make problem go away. Test is checking just for the word “flat” in the code.

1 Like

There was a changed to the regex which I believe has caused this issue.

Edit: The PR

1 Like