Within my TypeScript module, I have multiple array structures each intended to store distinct data sets.
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']
];
As I process additional data, I populate these arrays using the following method:
if (dealer.buService == 'B') {
monthlySheetB.push(cells);
} else if (dealer.buService == 'U') {
monthlySheetU.push(cells);
} else if (dealer.buService == 'PVT') {
monthlySheetPVT.push(cells);
}
The block of array declarations at the start may seem excessive. Is there a more concise way of defining these data structures?