Skip to content

Instantly share code, notes, and snippets.

@digitalicarus
Last active August 29, 2015 14:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save digitalicarus/9e6961988ed29e53bf6c to your computer and use it in GitHub Desktop.
Save digitalicarus/9e6961988ed29e53bf6c to your computer and use it in GitHub Desktop.
tiny functions
function between (n,l,h) { return n >= l && n <= h; }
function timesDo (n, f) { for (; n>0; n--) { f(n); } }
function repeatAcc(n,f) { var accum = []; for (; n>0; n--) { accum.unshift(f(n)); } return accum; }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment