Skip to content

Instantly share code, notes, and snippets.

@bwll
Created September 28, 2023 20:06
Show Gist options
  • Save bwll/a417b03d71f373785cc2b0919a5dbbec to your computer and use it in GitHub Desktop.
Save bwll/a417b03d71f373785cc2b0919a5dbbec to your computer and use it in GitHub Desktop.
const range = (start, end, step = 1) => {
let output = [];
if (typeof end === 'undefined') {
end = start;
start = 0;
}
for (let i = start; i < end; i += step) {
output.push(i);
}
return output;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment