Skip to content

Instantly share code, notes, and snippets.

@gladchinda
Created July 30, 2018 23:04
Show Gist options
  • Select an option

  • Save gladchinda/cdba659435221ec5818490d58708ce7e to your computer and use it in GitHub Desktop.

Select an option

Save gladchinda/cdba659435221ec5818490d58708ce7e to your computer and use it in GitHub Desktop.
function sum(...args) {
// Compute sum using array reduce()
return args.reduce((a, b) => a + Number(b), 0);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment