7 ms·
Because of prototypical inheritance. If the object's prototype has properties, you may not want iterate those. Where as `key in map` will and `hasOwnProperty()`
by jonpaul 12y ago
Because of prototypical inheritance. If the object's prototype has properties, you may not want iterate those. Where as `key in map` will and `hasOwnProperty()` will only return true on those properties on the object.
- jvickers 12y agoGenerally I want to look at properties from the prototype chain too.