I’m aware the the issue seems to have something to do with my Global var but I’m not sure why my resetting the global array in the steamroller function doesn’t pass.
var answer = [];
function flatten(source){
source.forEach((val) => Array.isArray(val)? flatten(val) : answer.push(val));
return answer;
}
function steamrollArray(arr) {
answer = [];
return flatten(arr);
}