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

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
User avatar
pedrotuga
Forum Contributor
Posts: 249
Joined: Tue Dec 13, 2005 11:08 pm

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

Post 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?
kpowell
Forum Newbie
Posts: 6
Joined: Thu Oct 09, 2008 4:11 pm

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

Post by kpowell »

b.length will give you a count
User avatar
pedrotuga
Forum Contributor
Posts: 249
Joined: Tue Dec 13, 2005 11:08 pm

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

Post by pedrotuga »

thank you
Post Reply