Skip to content

Instantly share code, notes, and snippets.

@dperuo
Last active August 30, 2023 15:21
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 dperuo/252b89f09f5e50237a39ccf55ab4fc06 to your computer and use it in GitHub Desktop.
Save dperuo/252b89f09f5e50237a39ccf55ab4fc06 to your computer and use it in GitHub Desktop.
const range = ({ min = 0, max = 10, step = 1}): number[] => {
return min > max ? [] : [min, ...range({ min: min + 1, max, step})].filter(item => item % step === 0);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment