Skip to content

Instantly share code, notes, and snippets.

:atom:

Kyle Amoroso kamoroso94

:atom:
  • Pittsburgh, PA
Block or report user

Report or block kamoroso94

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@kamoroso94
kamoroso94 / range.js
Last active Jan 26, 2019
A simple range generator in JavaScript for iterating through a left-closed, right-open interval
View range.js
function* range(start, end, step) {
if(end === undefined) {
end = start;
start = 0;
}
if(step === 0) throw new RangeError('step must be non-zero');
if(step === undefined) step = Math.sign(end - start);
const dir = Math.sign(step);
You can’t perform that action at this time.