I have an array with objects like this:
[{Date: null, Dossie1: null}, {Date: null, Dossie1: null}, {Date: null, Dossie1: null}]
And i need to assign to each specific objects property a value.
let dataset = Array(dates.length).fill(objectTemplate)
for (let i=0; i<dates.length; i++) {
dataset[i].Date = dates[i]
}
But the problem is that when i did it.
Each object is assign with the last item.
For instance if dates
has 3 value [1,2,3].
Property in array dataset
will be assign 3
not 1,2,3