title: How does AngularJS controller handle the res.json(false) value?
body: <p>I have an AngularJS controller that makes an HTTP get request to an API. The API can either return a <code>res.json(true)</code> or a <code>res.json(false)</code> value based on some condition.</p>
  
  <p>However, the controller seems to be ignoring this and I'm just curious to see how someone else would implement this:</p>
  
  <pre><code>function MyCtrl($scope, $http) {
    $http.get('/api/call').
      success(function(data, status, headers, config) {
        console.log(data); // --&gt; this prints out false
        if (data) { // --&gt; this evaluates and I'd expect this to fail, however
          console.log("true"); --&gt; this also shown
        }
      });
  </code></pre>
  
  <ol>
  <li>Should I modify my response from the api that it returns something else other than res.json(false)?</li>
  <li>Should I modify the code above to say something like <code>if (data === false)</code>?</li>
  </ol>