title: vue - display only if array contains an object
body: <p>I have a problem in my application.</p>
  <p>I want to display my objects only, if they aren't <code>null</code>. This works pretty well for the following object:</p>
  <pre><code>this.val.descripiton ? [
    'descripiton', {
      label: 'label.val.descripiton',
    },
  ] : null,
  </code></pre>
  <p>I got a <code>string</code> from the API and thats why it works and if it's <code>null</code> - it's hidden.</p>
  <p>But for the second object, I've a problem. Here I got an <code>array</code> from the API. The problem is that I always get this array, also when there are no values inside.</p>
  <pre><code>this.val.cities ? [
    'cities', {
      label: 'label.val.cities',
      display: cities =&gt; cities.join(', '),
    },
  ] &amp;&amp; this.val.cities.length &gt; 1 : null,
  </code></pre>
  <p>I want to check if the length is more than 1, if yes, display it. If no, hide it like the description. But I always get this error message in the console:</p>
  <pre><code>&quot;TypeError: Cannot read property 'length' of undefined&quot;
  </code></pre>
  <p>What am I doing wrong?</p>