Find max and min of nested array of nested array like
var arry=[1,2,[14,56,34,[48,98]],[14,16,11,[18,81]],34,35]
Find max and min of nested array of nested array like
var arry=[1,2,[14,56,34,[48,98]],[14,16,11,[18,81]],34,35]
You could flat the array first and then take the wanted method with spreaded values.
const
array = [1, 2, [14, 56, 34, [48, 98]], [14, 16, 11, [18, 81]], 34, 35],
flat = array.flat(Infinity),
min = Math.min(...flat),
max = Math.max(...flat);
console.log(min, max);