I've got a Json object named data
. It has the following content:
{"query":{"pages":{"856":{"pageid":856,"ns":0,"title":"Mededelingen","revisions":[{"*":"* News item number one\n* News item number two"}]}}},"query-continue":{"revisions":{"rvstartid":12446}}}
How do I go about returning News item number one\n* News item number two
?
I thought I would get that when using the following code:
console.log(data.query.pages.856.revisions.0);
However, this code returns errors.
SyntaxError: missing ) after argument list
Presumably because some of the object names are numbers. Also, I do not wish to refer to the object "name" 856
since this is dynamic.
The structure of the object will always have the same amount of sub-items. The names of the ID's can differ however.
Is there a way of always returning the inner message? No matter the given ID's? Inner message in my example being: News item number one\n* News item number two
.