I am creating an Array of days between 2 given dates, the keys should be formatted as DD/MM/YYYY and the values should be numbers (prices set for each date)
It seems to work because the Array contains the values I give it (via a date picker) but I can not loop through this Array, probably because it's length returns 0 even though it contains elements
Here is a screenshot of the console log statement
Here is the code that creates the Array
var arrayOfDatesBetween = new Array();
// daysBetween = integer representing the count of days between the chosen dates
for (let i = 0; i < daysBetween; i++) {
// just add one day on each iteration but keep count of the first
let q = i === 0 ? i : 1;
let _date = _dateIn.setDate(_dateIn.getDate()+q);
// lcsgDate() formats the date as I need it: DD/MM/YYYY
let __date = lcsgDate(_date);
// getDatePrice() gets the price for the given date by searching into another Array of date:price
arrayOfDatesBetween[__date] = getDatePrice(__date);
}
// result
console.log(arrayOfDatesBetween);