Created
August 22, 2022 21:32
-
-
Save peterkingsbury/c299847c42b5d899d1316d368a896774 to your computer and use it in GitHub Desktop.
Get the sum of the ASCII values of a string of text, in a single line of JavaScript
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
'hello, world'.split('').reduce((prev, curr) => { return prev + curr.charCodeAt(0); }, 0); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment