Skip to content

Instantly share code, notes, and snippets.

@prozbik
Last active February 14, 2016 20:16
Show Gist options
  • Save prozbik/74c51df6ca6fef47fa76 to your computer and use it in GitHub Desktop.
Save prozbik/74c51df6ca6fef47fa76 to your computer and use it in GitHub Desktop.
summation of all numbers from 1 up to x included
const summation = x => Number.isInteger(x) ? x * (x + 1)/2 : 'Invalid Value';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment