> You could do : myobj.hasOwnProperty(key) But then if myobj is NULL it will > throw an error.
Unless nil suddendly has keys, it wouldn't go into loop anyway. Personally I don't like forEach too much, since I cannot break from it, when I decide the rest is uninteresting. Or even return from the parents function. At least not without some oh-so-clever-but-ugly-misuse of exceptions. Why they didn't make the standard forEach in that returning false terminates the loop is beyond me, or even designed javascript so you can do "named returns", that is returning directly the closures parent, which only would work if the closure is not exported out of the function anyway. But honestly this is all off-topic to Node.js. To Node javascript comes with its quirks as it is, and is no language design project. -- 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 [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/nodejs?hl=en?hl=en
