title: Javascript, log what causes a boolean expression to fail
body: <p>I have a complex predicate in JavaScript that chains various tests against a value.</p>
  <p>I'd love to log <em>where</em> in the expression it fails, if it fails. Sort of like testing libraries that log out where an exception fails.</p>
  <p>Is there some sort of reflection I can do to extract some pretty description of what caused an expression to fail?</p>
  <p>e.g.,</p>
  <pre><code>const predicate = a.foo == 1 &amp;&amp; a.bar &lt; 3 &amp;&amp; someOtherPredicate(a.bar)
  
  // if predicate == false, console.log -&gt;
  // &quot;error: b.bar &lt; 3 evaluated to false&quot;
  
  (I'm actually interested in doing this in Typescript, but want to see what features JavaScript has that could enable this)
  </code></pre>