I have a multidimensional array of x columns and y rows. How can I find the min and the max value of the matrix? Example:
[[1, 37.8, 80.8, 41.8],
[2, 30.9, 69.
You can get max value of multi dimension array using following method:
var arr = [[1, 5,6], [4, 7,8], [3, 8,20], [2, 3,1],[12, 4,5]];
console.log(Math.max.apply(Math, arr.map(function (i) {
return i[0]+i[1]+i[2];
})));
It first use array.map() to convert the multi-dimensional array to a flat one, and after that use Math.max().