Created
March 7, 2016 16:58
-
-
Save esarbanis/25e35d543c06c9c8cfcd to your computer and use it in GitHub Desktop.
Print a numbers within a range with a particular offset
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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