title: Array filter with possible undefined properties
body: <p>I have an array of objects that may or not contain a property.</p>
  
  <p>So, in order to filter it, I do this:</p>
  
  <pre><code>array = array.filter(v =&gt; v.myproperty != undefined);
  array = array.filter(v =&gt; v.myproperty[0] != undefined);
  </code></pre>
  
  <p>This effectively removes the ones where <code>myproperty</code> is undefined and, afterwards, the ones where the first element inside <code>myproperty</code>.</p>
  
  <p>Is there a way of having a single liner that prevents me from applying <code>filter</code> to the array twice?</p>
  
  <p>Something like:</p>
  
  <pre><code>array = array.filter((v =&gt; v.myproperty || [])[0] != undefined);
  </code></pre>