John Gardner (2016-01-23T06:20:36.000Z)
gardnerjohng at gmail.com (2016-01-24T06:03:48.282Z)
Probably a stupid idea, and I can see it already being brought up several times... but why not extend spread operators to work with numeric ranges? ```js let a = [ 0 ... 3 ]; // Expands to: [ 0, 1, 2, 3 ] ``` This wouldn't be a groundbreaking feature, but it would allow better readability when plotting a range of values: ```js let esVersions = [ 1 ... 5, 2015 ]; ``` It might also be used to extract a range of values: ```js array[ 3 ... 6 ] = "ABCDEFGH"; // [ "D", "E", "F", "G" ] ``` Which I find far more readable than this: ```js array[ , , , , 3, 4, 5, 6 ] = "ABCDEFGH"; ``` Since it would require two numbers to be explicitly supplied on each side, there's no risk of it being misinterpreted as an attempt to spread an array. Decimal components would be dropped: ```js let a = [ 1 ... 3.9 ]; // [ 1, 2, 3 ] ``` This would complement Alican's suggested syntax for slicing an array of values, which modifies the original array. Thoughts? Just throwing crap out there.