If you are into coding challenges, you will find this very useful. Here are 3 snippets that give you the same results.
Array.from({ length: N }, (_, i) => i + 1); // => [1, 2, 3, 4, .., N]
[...Array(N).keys()].map((i) => i + 1); // => [1, 2, 3, 4, .., N]
[...Array(N).keys()]; // => [0, 1, 2, 3, 4, .., N]
Array.from(Array(N), (_, i) => i + 1); // => [1, 2, 3, 4, .., N]
Array.from(Array(N).keys()); // => [0, 1, 2, 3, 4, .., N]