On Sun, 12 Feb 2012 04:42:51 -0800 (PST), Shimon Doodkin wrote:
You could do : myobj.hasOwnProperty(key) But then if myobj is NULL
it
will throw an error.
It will probably throw 1 or 2 lines before in the "for (...)".
If you're using an object as a hash you can avoid it. If you want to be
sure, I use this:
for (k in obj) {
if (!obj.hasOwnProperty(k)) continue;
..
}
Or if I can, I don't need to handle "this" references, I use .forEach.
---
Diogo R.
--
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