I am in React.js consuming a JSON API. I am trying to loop through and get values from an array that is nested within an array.
When I do typeof on this.state.products[0] I get "Object" However, here is what it looks when I console.log it and it's parent.
{
"products": [
[
1,
1,
"2019-09-06",
"Tackle Amazon Machine Image",
"ami",
1000
],
[
2,
1,
"2019-09-06",
"Tackle for GovCloud",
"saas",
5000
]
]
}
How can I print only "Tackle Amazon Machine Image" ? THANK YOU!
I have tried
{this.state.products[0]["1"]}
{this.state.products[0][1]}
{this.state.products[0].[1]}
{this.state.products[0].["1"]}
{this.state.products[0]."1"}