Last active
June 27, 2017 10:06
-
-
Save AyoAlfonso/aadd20be715cd84718f0a647bbac9ab5 to your computer and use it in GitHub Desktop.
Highest Numbers in Simple Array
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
| var maxValue = null; | |
| for (var i = 0; i < myArray.length; i++) { | |
| if (maxValue === null || maxValue < myArray[i]) { | |
| maxValue = myArray[i]; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment