When working in TypeScript, there are two different ways to declare a map. The first way is like this:
{[key:number]string}
This shows an example of creating a map with keys as numbers and values as strings. However, you can also define a map like this:
Map<number, string>
What is the reason for having these two methods to achieve the same result, and what are the differences between them?