title: How to make the code dynamic in JavaScript
body: <p>I have a small piece of code and I need to make it dynamic. I want to increase the width and height of the code when the sets length increases.</p>
  
  <p><strong>venn-example.js</strong></p>
  
  <pre><code>if (sets.length &gt;= 0 &amp;&amp; sets.length &lt;=24){
  
      var chart = venn.VennDiagram().width(500).height(500);
  }
  
   else if (sets.length &gt;=25 &amp;&amp; sets.length&lt;=50){
  
      var chart = venn.VennDiagram().width(1000).height(800);
    }
  else if (sets.length &lt;=51 &amp;&amp; sets.length &gt;=100){
  
      var chart = venn.VennDiagram().width(1300).height(1300);
  }
  else if (sets.length &lt;=101 &amp;&amp; sets.length&lt;=150){
  
      var chart = venn.VennDiagram().width(1500).height(1600);
  }
  else if (sets.length &lt;=151 &amp;&amp; sets.length &gt;=250){
  
      var chart = venn.VennDiagram().width(1700).height(1900);
  }
  </code></pre>