javascript - Value substitution while accessing nested json object -
this json object
{ "a1": { "b1": { "name": "tim", "status": "completed" } "c1" { "field1": "name", "field2": "status" } }
i need access value tim getting field key within c1. example, need value of a1.c1.field1 gives me value name1 , need access value tim a1.b1.(value of a1.c1.field1) not know how this. can give possible ways accomplish this?
var a1 = { "b1": { "name": "tim", "status": "completed" }, "c1": { "field1": "name", "field2": "status" } }; console.log(a1.b1[a1.c1.field1]);
do fix error in json ;)
Comments
Post a Comment