Skip to main content
Stack Overflow
  1. About
  2. For Teams

Return to Question

Commonmark migration
Source Link

[Screenshot][1] [1]: https://i.sstatic.net/vaFtm.jpgScreenshot

[Screenshot][1] [1]: https://i.sstatic.net/vaFtm.jpg

Added more findings
Source Link
user8054217
user8054217

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

Updated question with my own findings
Source Link
user8054217
user8054217

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..?

added 269 characters in body
Source Link
user8054217
user8054217
Loading
added 269 characters in body
Source Link
user8054217
user8054217
Loading
deleted 25 characters in body
Source Link
user8054217
user8054217
Loading
Source Link
user8054217
user8054217
Loading
lang-js

AltStyle によって変換されたページ (->オリジナル) /