UNPKG
aureooms-js-array
Version:
latest (4.0.0)
4.0.0
3.1.0
3.0.0
2.2.1
2.2.0
2.1.0
2.0.2
2.0.1
2.0.0
1.2.0
1.1.0
1.0.0
0.0.5
0.0.4
0.0.3
0.0.2
0.0.1
array manipulation code bricks for JavaScript
aureooms.github.io/js-array/
aureooms/js-array
aureooms-js-array
/
src
/
utils
/
range.js
21 lines
(13 loc)
•
244 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
export
function range
(
start
, stop, step, out
)
{
if
(
step <
0
)
{ for
(
;
start
> stop ;
start
+= step
)
{ out.push
(
start
)
; } }
else
{ for
(
;
start
< stop ;
start
+= step
)
{ out.push
(
start
)
; } }
return
out; }