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

Popular posts from this blog

matlab - error with cyclic autocorrelation function -

django - (fields.E300) Field defines a relation with model 'AbstractEmailUser' which is either not installed, or is abstract -

c# - What is a good .Net RefEdit control to use with ExcelDna? -