Well, in < ES4 that is. On Feb 13, 9:43 am, Thom Blake <[email protected]> wrote: > > Or if you do make them DontEnum. > > DontEnum is not a property that can be set by the user. > > On Feb 12, 3:09 pm, Marcel Laverdet <[email protected]> wrote: > > > > > > > > > This is one of those old Crockfordisms that I definitely don't agree with. > > How about instead you just don't add garbage to Object.prototype? Or if you > > do make them DontEnum. Do you really write two-line loop headers every time > > you want a loop?? > > > On Sun, Feb 12, 2012 at 6:42 AM, Shimon Doodkin <[email protected]>wrote: > > > > for (var key in myobj) must be accompanied with > > > if(Object.hasOwnProperty.call(myobj,key)) > > > > example: > > > > for (var key in myobject) { > > > if(Object.hasOwnProperty.call(myobject,key)){ > > > ... > > > } > > > } > > > > myobject.forEach(function(){...}) already does this. > > > > more: > > > > You could do : myobj.hasOwnProperty(key) But then if myobj is NULL it > > > will throw an error. > > > So you use the method hasOwnProperty from the prototype object. > > > and you call it with changing the this object of it to your object. > > > > Object.hasOwnProperty.call(myobj,key) > > > > Most of you probably know this, but sometimes I encounter modules that > > > don't do this. > > > And they do unexpected errors. > > > > -- > > > 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
-- 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
