need to iterate thru json
hi..
in the below json i need to get the value of the id==8, but some better way. not thru data[1].children
- [
- {
- "id" : 1,
- "name" : "a",
- "children" : [
- {
- "id" : 2,
- "name" : "b",
- "children" : [
- {
- "id" : 3,
- "name" : "c",
- "children" : [
- {
- "id" : 4,
- "name" : "d",
- "children" : [
- {
- "id" : 5,
- "name" : "e",
- "children" : [
- {}
- ]
- }
- ]
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "id" : 6,
- "name" : "f",
- "children" : [
- {
- "id" : 7,
- "name" : "g",
- "children" : [
- {
- "id" : 8,
- "name" : "h",
- "children" : [
- {
- "id" : 9,
- "name" : "i",
- "children" : [
- {
- "id" : 10,
- "name" : "j",
- "children" : [
- {}
- ]
- }
- ]
- }
- ]
- }
- ]
- }
- ]
- }
- ]