diff options
| author | Priyansh <[email protected]> | 2022-01-20 19:30:19 -0500 |
|---|---|---|
| committer | Priyansh <[email protected]> | 2022-01-20 19:30:19 -0500 |
| commit | cb1b96bcc0c272f64f67aebce117c6008e3db91c (patch) | |
| tree | 8b8d78340943d30abaf217f00c3da914bf5cea30 /src/helpers/arrayFunctions.ts | |
| parent | 90be11f8e8ad16ef2a68d71d4523f813db18e6ef (diff) | |
| download | izuku.js-cb1b96bcc0c272f64f67aebce117c6008e3db91c.tar.xz izuku.js-cb1b96bcc0c272f64f67aebce117c6008e3db91c.zip | |
feat: support for multiple columns
Diffstat (limited to 'src/helpers/arrayFunctions.ts')
| -rw-r--r-- | src/helpers/arrayFunctions.ts | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/helpers/arrayFunctions.ts b/src/helpers/arrayFunctions.ts index 7e78e29..234e135 100644 --- a/src/helpers/arrayFunctions.ts +++ b/src/helpers/arrayFunctions.ts @@ -42,15 +42,15 @@ export function range( throw new Error('step must be greater than 0'); } - // If remove is specified, remove the values from the range - if (remove) { - for (let i = start; i <= end; i += step) { + // Generate an array from start to end + for (let i = start; i <= end; i += step) { + if (remove) { if (!remove.includes(i)) { rangeArray.push(i); } + } else { + rangeArray.push(i); } } - - // return the range return rangeArray; } |
