Skip to content

Instantly share code, notes, and snippets.

@esarbanis
Created March 7, 2016 16:58
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 esarbanis/25e35d543c06c9c8cfcd to your computer and use it in GitHub Desktop.
Save esarbanis/25e35d543c06c9c8cfcd to your computer and use it in GitHub Desktop.
Print a numbers within a range with a particular offset
class Range {
static ID:string = 'range';
static filter() {
return (num:number, offset:number = 1) => {
var res = [];
for (var i = offset; i <= num; i = i + offset) {
res.push(i);
}
return res;
};
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment