Page 1 of 1

Basica javascrip question: how do I count object's atributes

Posted: Tue Oct 14, 2008 6:58 pm
by pedrotuga
That's the question.

Code: Select all

a="a,b,v,asd,s,sasd";
b = a.split(',');
How do I get the number of elements of b?
A loop would do it, but isn't there a built in funciont?

Re: Basica javascrip question: how do I count object's atributes

Posted: Tue Oct 14, 2008 7:52 pm
by kpowell
b.length will give you a count

Re: Basica javascrip question: how do I count object's atributes

Posted: Tue Oct 14, 2008 8:34 pm
by pedrotuga
thank you