title: Object and primitive type equality
body: <p><strong>I know that identical objects are not equal, i.e:</strong></p>
  
  <pre><code>var obj = { name: "Value" };
  var obj2 = { name: "Value" };
  
  console.log("obj equals obj2: " + (obj === obj2)); //evaluates to false
  </code></pre>
  
  <p><strong>Yet primitive types are:</strong></p>
  
  <pre><code>var str = "string1";
  var str2 = "string1";
  
  console.log("str equals str2: " + (str === str2)); //evaluates to true
  </code></pre>
  
  <p>My question is why. Why are objects and primitives treated differently? If an object is nothing but an empty container, with only the attributes you specify to put in the container, why wouldn't the container's identical attributes evaluate to be the same? I looked around for this answer on SO and elsewhere, but didn't find an answer.</p>
  
  <p>Is a JS object treated as something different in the DOM than a primitive type?</p>
  
  <p>Thanks</p>