title: twig: check if all included arrays in an object are empty
body: <p>I have a twig variable containing a number of named array objects like this:</p>
  
  <pre class="lang-twig prettyprint-override"><code>{{ dump(trashbin) }}
  </code></pre>
  
  <p>Output:</p>
  
  <pre class="lang-php prettyprint-override"><code>array:2 [
    "Campaign" =&gt; []
    "ClientBudget" =&gt; []
  ]
  </code></pre>
  
  <p>What I'm currently doing is checking if the contained arrays have a length of 0:</p>
  
  <pre class="lang-twig prettyprint-override"><code>{% if trashbin.Campaign|length == 0 and trashbin.ClientBudget|length == 0 %}
  Nothing to undelete. Trashbin empty
  {% endif %}
  </code></pre>
  
  <p>In the future, any number of named arrays with names I cannot foresee may be added to that list.</p>
  
  <p>How can I simplify and generalize the check if all contained arrays are empty? I want to display a special message to the user in that case.</p>