Skip to content

Instantly share code, notes, and snippets.

@whmii
Created December 26, 2017 19:09
Show Gist options
  • Save whmii/c1e7fc9ee43f1b8dd6c681b8f5c9443c to your computer and use it in GitHub Desktop.
Save whmii/c1e7fc9ee43f1b8dd6c681b8f5c9443c to your computer and use it in GitHub Desktop.
Sum an array of strings
_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