> 
> On Sat, Jun 16, 2012 at 12:05 PM, Mark Hahn <m...@hahnca.com 
> (mailto:m...@hahnca.com)> wrote:
> > I highly recommend using underscore.  _.size and _.keys will get you what 
> > you want.
> > 
Why would you include an entire library to do a task that the native runtime is 
capable of?

Object.keys()Object.keys().length
 
Rick
> > 
> > On Sat, Jun 16, 2012 at 9:41 AM, dolphin 278 <dolphin...@gmail.com 
> > (mailto:dolphin...@gmail.com)> wrote:
> > > You can use Object.keys("yourobjectvariable") to get array of object 
> > > fields.
> > > In your example Object.keys("yourobjectvariable").length will be 2.
> > > ---------
> > > Boris Egorov
> > > skype/gtalk/nickname: dolphin278
> > > mobile: +7 905 728 1543 (tel:%2B7%20905%20728%201543)
> > > 
> > > 
> > > 
> > > On Sat, Jun 16, 2012 at 8:25 PM, vitoa <vitor.moinho...@gmail.com 
> > > (mailto:vitor.moinho...@gmail.com)> wrote:
> > > > Tanks a lot for the Object sugestion that works great :)
> > > > One more question.
> > > > How can I list all indexs in this object or the size, are there any
> > > > methods?
> > > > 
> > > > for example I have
> > > > table
> > > > { xxx: [ 'xxx', 'aaa', '123' ], zzz: [ 'zzz', 'aaa', '123333' ] }
> > > > 
> > > > How can I have the length of this table(should be 2) and show all
> > > > indexs available
> > > > I found that I only can acess the data if I have index name like
> > > > table['xxx']
> > > > 
> > > > Regards,
> > > > Vitor
> > > > 
> > > > --
> > > > Job Board: http://jobs.nodejs.org/
> > > > Posting guidelines: 
> > > > https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
> > > > You received this message because you are subscribed to the Google
> > > > Groups "nodejs" group.
> > > > To post to this group, send email to nodejs@googlegroups.com 
> > > > (mailto:nodejs@googlegroups.com)
> > > > To unsubscribe from this group, send email to
> > > > nodejs+unsubscr...@googlegroups.com 
> > > > (mailto:nodejs%2bunsubscr...@googlegroups.com)
> > > > For more options, visit this group at
> > > > http://groups.google.com/group/nodejs?hl=en?hl=en
> > > 
> > > -- 
> > > Job Board: http://jobs.nodejs.org/
> > > Posting guidelines: 
> > > https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
> > > You received this message because you are subscribed to the Google
> > > Groups "nodejs" group.
> > > To post to this group, send email to nodejs@googlegroups.com 
> > > (mailto:nodejs@googlegroups.com)
> > > To unsubscribe from this group, send email to
> > > nodejs+unsubscr...@googlegroups.com 
> > > (mailto:nodejs%2bunsubscr...@googlegroups.com)
> > > For more options, visit this group at
> > > http://groups.google.com/group/nodejs?hl=en?hl=en
> > 
> > -- 
> > Job Board: http://jobs.nodejs.org/
> > Posting guidelines: 
> > https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
> > You received this message because you are subscribed to the Google
> > Groups "nodejs" group.
> > To post to this group, send email to nodejs@googlegroups.com 
> > (mailto:nodejs@googlegroups.com)
> > To unsubscribe from this group, send email to
> > nodejs+unsubscr...@googlegroups.com 
> > (mailto:nodejs%2bunsubscr...@googlegroups.com)
> > For more options, visit this group at
> > http://groups.google.com/group/nodejs?hl=en?hl=en
> 
> -- 
> Job Board: http://jobs.nodejs.org/
> Posting guidelines: 
> https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
> You received this message because you are subscribed to the Google
> Groups "nodejs" group.
> To post to this group, send email to nodejs@googlegroups.com
> To unsubscribe from this group, send email to
> nodejs+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/nodejs?hl=en?hl=en

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

Reply via email to