test(range): Remove unncessary fallback value

This commit is contained in:
Sojin Park 2024-06-28 21:53:10 +09:00
parent 73cd00ecb7
commit ed145c509d

View File

@ -42,7 +42,7 @@ export function range(start: number, end?: number, step?: number): number[] {
throw new Error(`The step value must be a non-zero integer.`);
}
const length = Math.max(Math.ceil((end - start) / (step || 1)), 0);
const length = Math.max(Math.ceil((end - start) / step), 0);
const result = new Array(length);
for (let i = 0; i < length; i++) {