Extend your JavaScript Number
type with a 100 bytes polyfill:
require('range-prototype')
const list = [...10] // => [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 ]
yarn
$ yarn add range-prototype
npm
$ npm install range-prototype
then simply require it in your project:
require('range-prototype')
For old browsers
<script src="https://cdn.jsdelivr.net/npm/range-prototype@0.0.1/es5.js"></script>
<script>
[...5] // => [ 0, 1, 2, 3, 4 ]
</script>