title: Why does the second if-statement behave like this?
body: <p>The first case will execute, while the latter one will not.
  Can you please explain this to me?</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>function foo() {
    return "bar";
  }
  
  if (foo()) {
    console.log("This works!");
  }
  
  if (foo() == true) {
    console.log("This does not work!");
  }</code></pre>
  </div>
  </div>
  </p>