Having googled for it I found two solutions:
Here is a simple solution that works in codepen:
Array.from(Array(10).keys())
To be clear, Array.from() and Array.keys() require an ES6 polyfill in order to work in all browsers.
Array.from()
Array.keys()