Javascript examples for Array Operation:Array Search
Get maximum values of a multidimensional array with reduce function
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript"> window.onload=function(){/*from w w w . j a va2 s. c o m*/ var arr = [[4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]]; var out = arr.reduce(function (p, c) { return p.concat(Math.max.apply(null, c)); }, []); console.log(out) } </script> </head> <body> </body> </html>