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
I would code something like this:
function range(start, end) { return Array(end-start).join(0).split(0).map(function(val, id) {return id+start}); } range(-4,2); // [-4,-3,-2,-1,0,1] range(3,9); // [3,4,5,6,7,8]
It behaves similarly to Python range:
>>> range(-4,2) [-4, -3, -2, -1, 0, 1]