Skip to content

Instantly share code, notes, and snippets.

@davidsharp
Created December 17, 2021 10:23
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save davidsharp/eeb1e6e1a060ace3a16c3e7706fbaf3e to your computer and use it in GitHub Desktop.
Finds triangular number (or x + x-1 + x-2, etc down to 0)
const fn = x => x + (x * ((x-1)/2))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment