Skip to content

Instantly share code, notes, and snippets.

@iros
Created February 27, 2009 21:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iros/71718 to your computer and use it in GitHub Desktop.
Save iros/71718 to your computer and use it in GitHub Desktop.
Extend the javascript Array object to include max/min routines using the apply method
Array.max = function( array ){
return Math.max.apply( Math, array );
};
Array.min = function( array ){
return Math.min.apply( Math, array );
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment