mirror of
https://github.com/swc-project/swc.git
synced 2024-12-30 17:15:11 +03:00
c6b22c57f8
Co-authored-by: Fábio Santos <fabiosantosart@gmail.com>
10 lines
191 B
JavaScript
10 lines
191 B
JavaScript
function* range(start = 0, end = null, step = 1) {
|
|
if (end == null) {
|
|
end = start;
|
|
start = 0;
|
|
}
|
|
for (let i = start; i < end; i += step) {
|
|
yield i;
|
|
}
|
|
}
|