In PHP, you can do...
range(1, 3); // Array(1, 2, 3)
range(\"A\", \"C\"); // Array(\"A\", \"B\", \"C\")
That is, there is a function that l
d3 also has a built-in range function. See https://github.com/mbostock/d3/wiki/Arrays#d3_range:
d3.range([start, ]stop[, step])
Generates an array containing an arithmetic progression, similar to the Python built-in range. This method is often used to iterate over a sequence of numeric or integer values, such as the indexes into an array. Unlike the Python version, the arguments are not required to be integers, though the results are more predictable if they are due to floating point precision. If step is omitted, it defaults to 1.
Example:
d3.range(10)
// returns [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]