Created
February 5, 2014 15:56
-
-
Save wizard04wsu/8826715 to your computer and use it in GitHub Desktop.
Get the maximum and minimum values in an array.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//get max value in an array | |
//got this from http://addictedtonew.com/archives/482/javascript-array-max-and-equal-height-columns/ | |
if(!Array.prototype.max) Array.prototype.max = function max(){ return Math.max.apply({}, this); }; | |
//get minimum value in an array | |
if(!Array.prototype.min) Array.prototype.min = function min(){ return Math.min.apply({}, this); }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment