title: Why are 2 empty JavaScript functions or plain objects not equal
body: <p>In this snippet of code I'm defining two functions, outputting them and their string representations to console, and also comparing them:</p>
  
  <pre><code>var a = function func() {},
      b = function func() {};
  
  // string representations are equal
  console.log(a.toString());
  console.log(b.toString());
  console.log(a.toString() == b.toString());
  console.log(a.toString() === b.toString());
  
  // functions seem to be equal
  console.log(a);
  console.log(b);
  
  // but they're not really as this prints false
  console.log(a == b);
  console.log(a === b);
  </code></pre>
  
  <p>Why are they not equal?</p>
  
  <p>Same happens of course to empty plain objects, i.e. <code>{}</code>.</p>
  
  <p>Funny thing though is that lodash <code>isEqual</code> returns <code>true</code> in this case: <code>_.isEqual({}, {});</code> and <code>false</code> in this: <code>_.isEqual(function () {}, function () {})</code>. But of course it's not any proof, it's just the way of implementation of equality.</p>