Skip to content

Commit

Permalink
Update functions.export.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
JoseAlvesdev authored Jun 2, 2024
1 parent efbe412 commit c0983d1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/modules/functions.export.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
export function range(start: number, stop: number, step = 1) {
export function range(start: number, stop: number, step: number = 1) {
const isPositive = step > 0;
let numbers = [];
let numbers: Array<number> = [];

if (stop === undefined) {
stop = start;
start = 0;
}

for (let i = start; isPositive ? i < stop : i > stop; i += step) {
for (let i: number = start; isPositive ? i < stop : i > stop; i += step) {
numbers.push(i);
}

Expand Down

0 comments on commit c0983d1

Please sign in to comment.