If statement in google charts array
<p>Im trying to figure out how can I go about adding a if statement in a js array, i was thinking maybe a shorthand conditional would work but I am having no luck, this is what I have.</p>

<p>I am trying to only include the arrays if the values are not empty.</p>

<pre><code>gross1 = document.getElementById('gross1').value;
profit1 = document.getElementById('profit1').value;

gross2 = document.getElementById('gross2').value;
profit2 = document.getElementById('profit2').value;

gross3 = document.getElementById('gross3').value;
profit3 = document.getElementById('profit3').value;

function drawVisualization() {
var wrapper = new google.visualization.ChartWrapper({
          chartType: 'ColumnChart',
          dataTable: [['', 'Sales', 'Cost of Goods'],
                      ['Product 1', parseInt(gross1), parseInt(profit1)],
                        if(gross2 != '' &amp;&amp; profit2 != ''){
                      ['Product 2', parseInt(gross2), parseInt(profit2)],
                        }elseif(gross3 != '' &amp;&amp; profit != ''){
                      ['Product 3', parseInt(gross3), parseInt(profit3)]
                      }],
</code></pre>
