[Screenshot][1] [1]: https://i.sstatic.net/vaFtm.jpgScreenshot
[Screenshot][1] [1]: https://i.sstatic.net/vaFtm.jpg
edit2: The more I'm trying to find a solution, the more clueless I'm getting. Whenever I console.log trendData after setting it like this:
$.each(keyword.data, function(index, data) {
trendData[index] = data.popularity;
});
console.log(trendData);
It shows the object with the correct values 3 times, but upon opening it's only showing me the values of the last iteration???
[Screenshot][1] [1]: https://i.sstatic.net/vaFtm.jpg
edit2: The more I'm trying to find a solution, the more clueless I'm getting. Whenever I console.log trendData after setting it like this:
$.each(keyword.data, function(index, data) {
trendData[index] = data.popularity;
});
console.log(trendData);
It shows the object with the correct values 3 times, but upon opening it's only showing me the values of the last iteration???
[Screenshot][1] [1]: https://i.sstatic.net/vaFtm.jpg
But I'm gettingThis however gives me an error: trendDataset[index].push is not a function
edit: Walking through it step by step, it makes sense that this doesn't work. It loops through the first array once, creating the first dataset. Then it loops through the 2nd array three times, and then that pattern repeats itself.
I somehow need to be able to access the 2nd array's property, in the first array, like so:
trendDataset[index] = {
data: trendData.data.popularity
}
But how..?
But I'm getting: trendDataset[index].push is not a function
This however gives me an error: trendDataset[index].push is not a function
edit: Walking through it step by step, it makes sense that this doesn't work. It loops through the first array once, creating the first dataset. Then it loops through the 2nd array three times, and then that pattern repeats itself.
I somehow need to be able to access the 2nd array's property, in the first array, like so:
trendDataset[index] = {
data: trendData.data.popularity
}
But how..?