I am working with a 2D array that's structured like this:
var data = [['Version', 'Number'], [ 'V1.0', 1 ], [ 'V2.0', 2 ]];
My goal is to parse through the array and extract 'V1.0' and 'V2.0' into a new array, as well as '1' and '2'. This separation is needed for integration with Chart.js
The loop I am currently using is as follows:
var versionLabels = [];
var numberData = [];
for (var i=0; i<data.length; i++) {
versionLabels.push(data[i][0]);
}
for (var j=0; j<example.length; j++) {
numberData.push(data[j][1]);
}
I'm struggling with properly segregating each element into their respective arrays for future use.