Created
September 28, 2020 06:02
-
-
Save JeffreyBodin/f1c2dc8777b354a82a6411432d2be7bb to your computer and use it in GitHub Desktop.
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
// 2020-09-28 | |
// Javascript - Reference | |
// img archive: https://i.imgur.com/hOLhbmw.png | |
// License: | |
// https://creativecommons.org/licenses/by-sa/4.0/ | |
// https://stackoverflow.com/a/30060894 | |
Use: | |
var arr = [1, 2, 3, 4]; | |
var largest = arr.reduce(function(x,y) { | |
return (x > y) ? x : y; | |
}); | |
console.log(largest); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment