title: When do I need to use hasOwnProperty()?
body: <p>I read that we should always use hasOwnProperty when looping an object, because the object can be modified by something else to include some keys we don't want.</p>
  <p>But is this always required? Are there situations where it's not needed? Is this required for local variables too?</p>
  <pre><code>function my(){
    var obj = { ... };
    for(var key in obj){
      if(obj.hasOwnProperty(key)){
        safe
      }
    }
  }
  </code></pre>
  <p>I just don't like adding an extra <em>if</em> inside the loop if I don't have to.</p>
  <p><em><a href="http://phrogz.net/death-to-hasownproperty" rel="noreferrer">Death to hasOwnProperty</a></em></p>
  <p>This guy says I shouldn't use it at all any more.</p>