In my TypeScript module, I have a series of array structures where each of them will hold separate data.
var monthlySheetP = [
['Year', 'Month', 'Program', 'Region', 'Market', 'Country', 'Started', 'Completed']
];
var monthlySheetV = [
['Year', 'Month', 'Program', 'Region', 'Market', 'Country', 'Started', 'Completed']
];
var monthlySheetT = [
['Year', 'Month', 'Program', 'Region', 'Market', 'Country', 'Started', 'Completed']
];
var monthlySheetB = [
['Year', 'Month', 'Program', 'Region', 'Market', 'Country', 'Started', 'Completed']
];
var monthlySheetU = [
['Year', 'Month', 'Program', 'Region', 'Market', 'Country', 'Started', 'Completed']
];
var monthlySheetPV = [
['Year', 'Month', 'Program', 'Region', 'Market', 'Country', 'Started', 'Completed']
];
var monthlySheetPT = [
['Year', 'Month', 'Program', 'Region', 'Market', 'Country', 'Started', 'Completed']
];
var monthlySheetVT = [
['Year', 'Month', 'Program', 'Region', 'Market', 'Country', 'Started', 'Completed']
];
var monthlySheetPVT = [
['Year', 'Month', 'Program', 'Region', 'Market', 'Country', 'Started', 'Completed']
];
I iterate through some other data and start populating these arrays in the following way;
if (dealer.buService == 'B') {
monthlySheetB.push(cells);
} else if (dealer.buService == 'U') {
monthlySheetU.push(cells);
} else if (dealer.buService == 'PVT') {
monthlySheetPVT.push(cells);
}
Array declaration block at the top appears to be too verbose. Is there more elegant way of declaring these data structures?