I have some JSON which I have in a object but I can seem to return the values a sample of the json is as follows.
{ \"rootLayout\":\"main\", \"layoutDescriptions
Are you trying to get one of layoutDescriptions with id equals to obj.rootLayout?
layoutDescriptions
id
obj.rootLayout
var targetLayout = {}; for(var i = 0; i < obj.layoutDescriptions.length; i++) { if(obj.layoutDescriptions[i].id == obj.rootLayout) { targetLayout = obj.layoutDescriptions[i]; break; } } console.log(targetLayout);