You could loop through the elements and count them like this.
var hashLength = function(hash) {
var count = 0;
for (var i in hash) count++;
return count;
};
--
Brandon Aaron
On 1/30/07, Nate Cavanaugh <[EMAIL PROTECTED]> wrote:
>
> Hi All,
> is there a native, or jQuery way to check
Hi All,
is there a native, or jQuery way to check the size/length of a hash object?
For instance to check the length of an array, you would do something like:
var x = [1,2];
x.length; // is 2
But how would I check this:
var x = {n:2,m:4};
Thanks in advance :)
--
View this message in context: