Skip to content

Instantly share code, notes, and snippets.

@nicholasaiello
Created October 6, 2017 13:37
Show Gist options
  • Save nicholasaiello/36844d96e898cafcaebfe37617e54dc8 to your computer and use it in GitHub Desktop.
Save nicholasaiello/36844d96e898cafcaebfe37617e54dc8 to your computer and use it in GitHub Desktop.
Sum a sequence of numbers from 1 ... n
const sumToN = (n) => ( n * (n + 1) / 2 )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment