To generate a range within the supplied bounds with JavaScript, we use the array keys
method.
For instance, we write
const a = Array.from(Array(10).keys());
to call Array(10).keys()
to get an array of indexes of the array with length 10.
Then we use Array.from
to create a copy of the array and return it.