javascript - How read of Object.keys() value JSON? -
how read of object.keys() value json ?
i trying read value key name, give error:
keys dynamic
{ "marka1": { "name": "mika", }, "beti1": { "name": "yii", } }
var ojson = json.parse(objectjson); var keys = object.keys(ojson); //read key console.log("test - " + ojson.keys[0].name); //give error
change console.log("test - " + ojson[ keys[0] ].name);
because keys[0]
string.
Comments
Post a Comment