I would like to get length of the array in this object:
obj = {'2012-08-08':[1,2,5,8]}
I understand we can get length like this:
obj['2012-08-08'].length
But if it is not known the name of the key how we get the length of the array?
Say I have a loop:
_.each(dates, function(date){
//each date is like the above javascript object, how to get the length of the array?
})
{date:'2012-08-08', values:[1,2,5,8]}will do the trick better._, then please switch the tag back.