标签: javascript jquery json
var Newdata = [ { "FirstName" : "John" , "Sal" : 10 }, { "FirstName" : "Anna" , "Sal" : 30 }, { "FirstName" : "Peter" , "Sal" : 30 }, { "FirstName" : "Hemant" , "Sal" : 30 },]; alert(Newdata.length);
答案 0 :(得分:4)
尝试使用Object.keys()之类的,
alert(Object.keys(Newdata[0]).length);
Demo