Imagine having 2 distinct arrays:
var array1 = [1,1,1];
var array2 = [2,2,2];
How can a parent array be created that contains the following 2 objects?
(The goal is to insert the given arrays above into a parent array with 2 objects while also creating the objects to include the specified keys. This is necessary for compliance with the ng2-charts ChartDataSets type.)
// The desired outcome is shown below, however, only the 2 arrays above are available at this point
[
{ data : array1, label: 'some label1' },
{ data : array2, label: 'some label2' },
]