find max number question
by haikutear
JavaScript
/**
You are given an array where each elmeent can be a number of an array of numbers. This nesting goes arbitrarily deep. Write a function to find the maximum number in that array. For example:
[1, 3, 2] => 3
[1, [2, 3, 4], 3] => 4
[1, 2, [6, 5, [4, 5]], 3] => 6
*/
const arrayOfNumbers = (arr) => {
return arr.reduce((prev, current) => {
});
};