Hardly an hour goes by without someone asking a question about how to access a particular piece of data that they got from parsing JSON. The most recent is
Retrieving JSON and extracting a specific value
It seems like 99% of the time, as in this one, they just didn't notice that part of the object is an array, and they need to index it.
Are these questions really of any value to the community? Every one of them is a one-off, although I suppose if someone read one of them it might give them a clue to the mistake they made in their program. They're all so trivial that it doesn't seem worthwhile posting a real answer -- I'd like to just post the corrected expression as a comment and close it, but what close reason?
Is there a canonical question that explains how to read JSON and turn it into access expressions? Then they could be closed as dupes of that. If there are different ones for various languages, that would be fine, too.
=
instead of==
, using||
instead of&&
when testing for a variable not equal to many things, forgetting parentheses when usingAND
andOR
together in SQL, etc. So answers are likely to help future readers, except that they'll never find the previous questions on their own.a
property in theb
property.