mirror of
https://github.com/swc-project/swc.git
synced 2024-12-21 12:41:54 +03:00
8 lines
175 B
JavaScript
8 lines
175 B
JavaScript
|
function* range(start = 0, end = null, step = 1) {
|
||
|
if (null == end) {
|
||
|
end = start;
|
||
|
start = 0;
|
||
|
}
|
||
|
for (let i = start; i < end; i += step) yield i;
|
||
|
}
|