jjpd jjpd - 1 year ago 42
Javascript Question

number of dates in json

I have a javascript code

var dayarray = eval(data);
console.debug(dayarray);


it returns me following output

[
Object { Date=0.9090909090909091, Amount=699.9999999999999},
Object { Date=0.8333333333333334, Amount=699.9999999999999},
Object { Date=0.7692307692307693, Amount=699.9999999999999},
Object { Date=0.7142857142857143, Amount=3430.7692307692305},
Object { Date=0.6666666666666666, Amount=699.9999999999999},
Object { Date=0.625, Amount=699.9999999999999},
Object { Date=0.5882352941176471, Amount=699.9999999999999},
Object { Date=0.5555555555555556, Amount=699.9999999999999}
]


I want to know the number of dates.

Answer Source

So you want the length of the array ? dayarray.length

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download