(start, end, step, offset)
| 1328 | return this.arange(start, end, step); |
| 1329 | } |
| 1330 | arange(start, end, step, offset) { |
| 1331 | const len = (Math.abs(end - start) + ((offset || 0) * 2)) / (step || 1) + 1; |
| 1332 | const direction = start < end ? 1 : -1; |
| 1333 | const startingPoint = start - (direction * (offset || 0)); |
| 1334 | const stepSize = direction * (step || 1); |
| 1335 | |
| 1336 | return Array(len).fill(0).map((_, index) => startingPoint + (stepSize * index)); |
| 1337 | } |
| 1338 | range(n) { |
| 1339 | return this.arange(0, n, 1); |
| 1340 | } |
no test coverage detected