javascript - Accessing fields in JSON object -
this question has answer here:
in json object trying access "name" field within "pos"
i have tried obj.tokens.pos.parent; obj[0].pos.parent;
how can access parent field of object?
the object looks like
[ { "tokens": [ { "text": "call", "normalised": "call", "end": true, "start": true, "pos": { "name": "infinitive verb", "example": "eat", "parent": "verb", "tense": "present", "tag": "vbp" }, "pos_reason": "lexicon", "analysis": { "word": "call", "next": null, "last": null, "form": "infinitive", "tense": "present", "which": { "name": "infinitive verb", "example": "eat", "parent": "verb", "tense": "present", "tag": "vbp" }, "negative": false } } ] } ]
here result in array format need access array element obj[0]
obj[0].tokens[0].pos.name
Comments
Post a Comment