Having googled for it I found two solutions:
var data = [...Array(10).keys()];
console.log(data);
var data1 = Array(8).fill().map((_, i) => i);
console.log(data1);
data1 displays [0, 1, ..., 7] however data just displays [[object Array Iterator]] how do I actually see the numbers.
I need it for some iterations over numbers (part of Euler project).
Previously I did a lot of Euler challenges in Python. Now I decided I'll revisit it and do as much as I can in JS (as much ES6 syntax as possible) to help me develop my js skills.