JSFiddle - React, Tailwind, and code Playground
JavaScript
var myData = {
"result": "success",
"theBox": {
"Brands": [{
"lastPublishTime": null,
"id": "e054e3d5-143c-4eab-9fc2-7740edce7d09",
"lastUpdateTime": "09:42 Sun Apr 27 2014 BST",
"name": "Brand A"
}, {
"lastPublishTime": "09:42 Tue Apr 29 2014 BST",
"id": "402f3c42-3d8d-45d6-8c50-c5d1b5025c23",
"lastUpdateTime": "09:42 Sun Apr 27 2014 BST",
"name": "Brand B"
}],
"Products": [{
"lastPublishTime": null,
"id": "db35610c-3148-4b89-856c-66f907206037",
"lastUpdateTime": "09:42 Sun Apr 27 2014 BST",
"name": "Product 1"
}],
"OtherStuff": []
}
}
var x = Object.keys(myData.theBox)
for (var i=0; i < x.length; i++) {
var nodesCount = myData.theBox[x[i]].length;
for (var j=0; j < nodesCount; j++) {
alert("Name :" + myData.theBox[x[i]][j].name);
}
}