I am trying to create a simple array that would copy already existing data from array of objects in an API.
All of this I do in the part of the code. I declare my array in:
data() {
return {
Data: null, //this is getting data from API correctly I am interested in Data.hourly[i].dt values(Data.hourly[0].dt = some value (works))
timetable: [] }}
later I made a method in methods(which I call I checked it) to methods:
insertTimeTable(){
for (i in Data.hourly)
{
this.timetable.push({
date: this.Data.hourly[i].dt})
}
}
How to make it work and why it does not?