In a class:
private stuff: Map<number, string> = new Map();
...
this.stuff[aNumber] = "hello";
Gives this error:
Element implicitly has an
anytype because expression of typenumbercan't be used to index typeMap<number, string>.No index signature with a parameter of type
numberwas found on typeMap<number, string>
This makes no sense to me. Why doesn't Map<number, string> declare an index signature with a parameter of type number?