Skip to content

Instantly share code, notes, and snippets.

@Alex1990
Created March 9, 2017 16:44
Show Gist options
  • Save Alex1990/d561ee160d78b2d738f05ecb1bf101e4 to your computer and use it in GitHub Desktop.
Save Alex1990/d561ee160d78b2d738f05ecb1bf101e4 to your computer and use it in GitHub Desktop.
// Use rest operator and reduce method
function sum(...args) {
return args.reduce((a, b) => a + b);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment