Medium
This question is a daily question and will count towards your daily streak.
You're debugging an array manipulation utility. What will be the final result of this array transformation?
1function transformArray(arr) {2 return arr3 .filter(n => typeof n === 'number' && !isNaN(n))4 .map(n => n * 2)5 .reduce((acc, curr) => {6 if (curr > 10) {7 acc.large.push(curr);8 } else {9 acc.small.push(curr);10 }11 return acc;12 }, { small: [], large: [] });13}1415const input = [2, '4', 6, null, 8, NaN, 3];16console.log(transformArray(input));