Created
March 17, 2021 22:35
-
-
Save ugultopu/35bb00a7fc8d1e18a78c51e1470663b8 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
strings.reduce( | |
(max, string) => string.length > max ? string.length : max, | |
0 | |
); | |
// Or, more verbose version: | |
strings.reduce( | |
(max, string) => { | |
if (string.length > max) return string.length; | |
else return max; | |
}, | |
0 | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment