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
Code :
for (i = 0; i < XArray.length; i++) {
var pointsArray = [];
for (j = 0; j < 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;
}