I would like to create a Map total which can be used like: total['cashBalance'].sum
based on existing data
const fields = ['cashBalance', 'openTradeEquity', 'initialMargin', 'optionValue', 'treasuries', 'margin'];
I am trying as below but it is not working.
const total: Map<string, {sum: number}> = fields.map(f => [f, {sum: 0}]) ;
Surely, I am not getting the syntax right... can anyone please help me with this? Thanks Anand