title: Typescript and filter Boolean
body: <p>Consider following <a href="https://www.typescriptlang.org/play/#src=var%20a%3A%20(number%20%7C%20null)%5B%5D%20%3D%20%5B0%2C%201%2C%202%2C%203%2C%20null%2C%204%2C%205%2C%206%5D%3B%0D%0Avar%20b%3A%20%7B%20value%3A%20number%3B%20%7D%5B%5D%20%3D%20a.map(x%20%3D%3E%20x%20!%3D%20null%20%26%26%20%7B%20value%3A%20x%20%7D).filter(Boolean)%3B" rel="noreferrer">code</a> with <code>strictNullChecks</code> turned on:</p>
  
  <pre><code>var a: (number | null)[] = [0, 1, 2, 3, null, 4, 5, 6];
  var b: { value: number; }[] = a.map(x =&gt; x != null &amp;&amp; { value: x }).filter(Boolean);
  </code></pre>
  
  <p>It fails to compile due to:</p>
  
  <pre><code>Type '(false | { value: number; })[]' is not assignable to type '{ value: number; }[]'.
    Type 'false | { value: number; }' is not assignable to type '{ value: number; }'.
      Type 'false' is not assignable to type '{ value: number; }'.
  </code></pre>
  
  <p>But it is absolutely clear, that <code>false</code> will be filtered away by <code>.filter(Boolean)</code>.</p>
  
  <p>Same problem with <code>null</code>.</p>
  
  <p>Is there a way (except writing <code>as number[]</code>) to mark that value doesn't contain <code>false</code> or <code>null</code>?</p>