/ Published in: JavaScript

Get the min / max value from array.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
var my_array = new Arra("10","20","5"); Array.max = function( array ){ return Math.max.apply( Math, array ); }; Array.min = function( array ){ return Math.min.apply( Math, array ); }; // use like: var biggestValue = Array.max(my_array);
Comments
