Created
December 26, 2017 19:09
-
-
Save whmii/c1e7fc9ee43f1b8dd6c681b8f5c9443c to your computer and use it in GitHub Desktop.
Sum an array of strings
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
_sum(array) { | |
let arrayNum = array.map(Number); | |
return arrayNum.reduce((sum, x) => sum + x); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment