How to declare a map in typescript where the key could be a string | number and the value could be for example a number.
I'm trying the following and get an error
let aMap : { [key: string | number]: number } = {}
I get the following error in VS Code
[ts] An index signature parameter type must be 'string' or 'number'.
Note: I do not want to use the keyword "Map" in typescript. As just declaring:
let aMap : { [key: string]: number } = {}
works fine, I'm just having issues creating map with multiple key types