Ashish Vishwakarma

Ashish Vishwakarma

  • 378
  • 4.4k
  • 1.4m

Traversing in JSON Data

Oct 1 2015 5:30 AM
I have a JSON data as shown below, I want to traverse into it with loop, but data.length is returning 1 while it should return 2.
Please help me out how can I traverse into data with loop without modifying it
 
var data=[{
"468040": {
"Author": "William von Hagen",
"Title": "Ubuntu Linux Bible"
},
"541115": {
"Author": "Lohith G.N.",
"Title": "Windows Phone 7.5 Application Development with F#"
}
}]
alert(data.length);  //returning 1 instead of 2
 

Answers (4)