title: loop multiple arrays javascript
body: <p>I have the following structure:
  <a href="https://i.stack.imgur.com/cc35U.png" rel="nofollow noreferrer">objet and arrays</a></p>
  <p>I would like to determine if the object has an array with values ​​and if so, save those values ​​by saving those values ​​in another arryar that I will then go through, I have the following up to now:</p>
  <pre><code>if (resp.Boutique.length &gt;= 1) {
      for (let index = 0; index &lt; resp.Boutique.length; index++) {
          this.general.push(resp.Boutique[index]);
      }
  }
  
  
  
  if (resp.Curso.length &gt;= 1) {
      for (let index = 0; index &lt; resp.Curso.length; index++) {
          this.general.push(resp.Curso[index]);
      }
  }
  
  if (resp.Deporte.length &gt;= 1) {
      for (let index = 0; index &lt; resp.Deporte.length; index++) {
          this.general.push(resp.Deporte[index]);;
      }
  }
  </code></pre>
  <p>but if you have more 'if' elements, I do not think it's the best way.</p>
  <p>Any recommendation?</p>