Just another ES6 version.
By making use of Array.from second optional argument:
Array.from(arrayLike[, mapFn[, thisArg]])
We can build the numbered array from the empty Array(10)
positions:
Array.from(Array(10), (_, i) => i)
var arr = Array.from(Array(10), (_, i) => i);
document.write(arr);