loop through json array code example
Example 1: loop through json array python
for restaurant in data['restaurants']:
print restaurant['restaurant']['name']
Example 2: loop through json array and get key name
function iterateNodes(data) {
for (var i = 0, l = data.nodes.length; i < l; i++) {
var node = data.nodes[i];
console.log(node.name);
if (node.nodes) {
arguments.callee(node);
}
}
}
iterateNodes(data);