Last Updated: February 25, 2016
·
235
· kdimatteo

JS Object Iteration & Object Prototypes

Don't iterate over prototypes:

for(var prop in obj) {
    if(obj.hasOwnProperty(prop))
        doSomethingWith(obj[prop]);
 }