I am currently facing an issue with my map implementation where I have strings set as keys and values. However, when attempting to retrieve a value using a key, I encounter an error.
Below is the code snippet that I am working with:
let map:Map<string, string> = { [ "key1": "hello world 1" ], ["key2": "hello world 2"] } ;
alert( JSON.stringify(map.get("key")) );
The exception that was thrown is displayed below:
VM133:4 Uncaught TypeError: map.get is not a function
at eval (eval at exec (typescript.js:41), <anonymous>:4:26)
at exec (typescript.js:41)
at HTMLDocument.runScripts (typescript.js:41)
If you could provide insights into what mistake I may be making, I would greatly appreciate it.
Thank you for your assistance.