Skip to content

Instantly share code, notes, and snippets.

@fronterior
Created February 25, 2022 22:41
Show Gist options
  • Save fronterior/a5a083e12f0705f9a6ffb878651a27d7 to your computer and use it in GitHub Desktop.
Save fronterior/a5a083e12f0705f9a6ffb878651a27d7 to your computer and use it in GitHub Desktop.
const range = (first, last, dist = (last - first) / Math.abs(last - first)) => Array.from({length: Math.ceil((last - first) / dist)}, (_, i) => first + i * dist);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment