The Array.from
function has a second parameter that lets you map each item to a new value.
The first argument of the map function is the current value or undefined
if you don't have an existing list (as in the example below). The second argument is the index.
const items = Array.from({ length: 5 }, (value, idx) => idx + 1);
console.log(items); // [1, 2, 3, 4, 5]