Javascript examples for Array Operation:Array Search
Finding the largest numbers in a subarray
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript"> window.onload=function(){/*w w w . j a va 2s . c o m*/ var largest = function largest(arr) { return arr.map(function(arr) { return Math.max.apply(null, arr); }); }; console.log(largest([[41, 15, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]])); } </script> </head> <body> </body> </html>