I was talking about hasOwnProperty with another developer and how you are supposed to use it in for-in loops in javascript and he had a good question. When you do a for-in loop, why doesnt toString, hasOwnProperty, and other built in methods show up in the loop?
I was talking about hasOwnProperty with another developer and how you are supposed to
Share
The ECMAScript defines several properties for each property found on objects such as in prototypes. One of these is the
enumerableproperty, and if it is set tofalse, then that property will be skipped.You can actually manipulate these properties using the
definePropertyfunction: