title: Add null values to Array Javascript
body: <p>I am trying to build the series of data for highcharts to plot my graph.</p>
  
  <p>My array needs to read as YaxisValuesArray = [null, 78.12,null, null, null] - ;
  instead my array is [,78.12,,,] because of which my graph is not coming up.</p>
  
  <p>Below is my code</p>
  
  <pre><code> var n = parseInt(releaseprod);
                  if (!isNaN(n)) {
  
                      var number = parseFloat(releaseprod);
                      if (number &gt; 0)
                          YaxisValuesArray.push(parseFloat(releaseprod).toFixed(2));
                      else
                          YaxisValuesArray.push(parseInt(releaseprod));
                  }
                  else {
                      releaseprod = null;
                      YaxisValuesArray.push(releaseprod);
  
                  }
                   YaxisValuesArray.join(" , ");
  </code></pre>
  
  <p>Though I am explicity pushing the null value to the array. My alert still reads it as  [,78.12,,,].</p>
  
  <p>Highchart code : just for series </p>
  
  <pre><code>  series: [{
              showInLegend: true,
              name: 'Values',
              data: YaxisValuesArray //[,78.1,,,] --- NOt able to plot the graph
              //data: [null, 78.1, null, null, null]  -- Able to plot the graph
  
  
          }]
  </code></pre>
  
  <p>Someone please tell me how to add null values to the array so that my graph comes up.</p>