Skip to content

Instantly share code, notes, and snippets.

@thinkbigthings
Created March 13, 2018 11:26
Show Gist options
  • Save thinkbigthings/494a61181d67d6427a1f46859ed60e38 to your computer and use it in GitHub Desktop.
Save thinkbigthings/494a61181d67d6427a1f46859ed60e38 to your computer and use it in GitHub Desktop.
// Math.max overflows if array is too big, use reduce instead
const fastMin = (array) => array.reduce( (a,b) => (a < b) ? a : b );
const fastMax = (array) => array.reduce( (a,b) => (a > b) ? a : b );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment