Created
June 8, 2010 17:46
-
-
Save sidonath/430390 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| Array.prototype.min = Math.min; | |
| function smallest(array){ | |
| return array.min; | |
| } | |
| function largest(array){ | |
| return Math.max.apply( Math, array ); | |
| } | |
| assert(smallest([0, 1, 2, 3]) == 0, "Locate the smallest value."); | |
| assert(largest([0, 1, 2, 3]) == 3, "Locate the largest value."); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment