Apoorv Parijat
Apoorv Parijat

Reputation: 871

Why is the property of JSON object not accessible?

I'm not able to access progress property of data object. I used debugger to stop the application and check if data object is defined. Here's the screenshot of the console and it completely makes no sense.

Console Screenshot

Upvotes: 0

Views: 453

Answers (2)

thescientist
thescientist

Reputation: 2948

Data is an array, as evidenced by the fact that in the console it has brackets.

In order to access the object inside it, you need to use array index notation, like so:

data[0].progress  //0

Upvotes: 2

Dan D.
Dan D.

Reputation: 74675

data is an Array. You want data[0].progress.

Upvotes: 5

Related Questions