I have this function
function getDaysArray(days: number): number[] {
        return [...new Array(days)].map((_x, i) => {
            return i + 1;
        });
}
which is supposed to return an array of days by month,
so for example If I log getDaysArray(31) I expect to have an array like this
[1,2,...,31]
but instead, I am getting this:
[empty × 31]
Does anyone know what is happening?
 
     
    