Dumb Breakthrough moment: JSON Object Array Access

Jen Chan - Oct 1 '18 - - Dev Community

After being stuck on this for half an hour a friend takes a look at my Vue and server code.

"You're not actually accessing the arrays, you're only receiving the response as an object."

Seinfeld music plays

This is what I saw when I console.log-ed this.response.data

JSON response object from call to a Google Sheets endpoint. This object included an array of row objects, which contained arrays of info about cats that I couldn't access and thus iterate through in a v-for loop

This is what I should see if I want to iterate through arrays of row objects: this.response.data.rows

JSON response object targetting its arrays of row-objects by dot-notation

Thanks to Conan Lai for clearing that up.

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Terabox Video Player