[ ...Array(N).keys() ].map( i => i+1);
Here is what the above code is Doing:
1. We’re creating an array of N elements.
2. We’re mapping each element to its index + 1.
3. We’re using the spread operator to convert the array-like object into an array.