MCPcopy Create free account
hub / github.com/d3/d3-array / range

Function range

src/range.js:1–13  ·  view source on GitHub ↗
(start, stop, step)

Source from the content-addressed store, hash-verified

1export default function range(start, stop, step) {
2 start = +start, stop = +stop, step = (n = arguments.length) < 2 ? (stop = start, start = 0, 1) : n < 3 ? 1 : +step;
3
4 var i = -1,
5 n = Math.max(0, Math.ceil((stop - start) / step)) | 0,
6 range = new Array(n);
7
8 while (++i < n) {
9 range[i] = start + i * step;
10 }
11
12 return range;
13}

Callers 1

range-test.jsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…