title: Empty array after pushing to another array
body: <p>I want to push array A to B inside cycle and then and for every iteration of B i need to delete array A and create new one. I get all data before clearing the array, but after clearing I get array B with empty values </p>
  
  <p>Code :</p>
  
  <pre><code>for (i = 0; i &lt; XArray.length; i++) {
      var pointsArray = [];
  
      for (j = 0; j &lt; XArray.length; j++) {
  
          if (XArray[i] == XArray[j]) {
              pointsArray.push([parseFloat(YArray[i]), parseFloat(ZArray[i])]);
          }
      }
  
      dataSource.push({
          name: i,
          data: pointsArray
      });
      pointsArray.length = 0;
  }
  </code></pre>