--
You received this message because you are subscribed to the Google Groups "nodejs" group.
To post to this group, send email to nod...@googlegroups.com.
To unsubscribe from this group, send email to nodejs+un...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/nodejs?hl=en.
And something like:
console.log(gs.hasOwnProperty);
before the if.
--
Vyacheslav Egorov
Either
- gs is not an instanceof Object, or
- Object.prototype.hasOwnProperty is being shadowed.
--
Jorge.
Object.prototype.hasOwnProperty.call(object, property)
It's also especially important to do if "hasOwnProperty" itself could be a key in your object...
var set = {};
set["hasOwnProperty"] = "blah";
...
set.hasOwnProperty("foo")
Oops.
This is the safest way to use hasOwnProperty
Object.prototype.hasOwnProperty.call(object, property)