As I attempt to translate Java code using Maps into Typescript, it became apparent that using Maps in Typescript did not align with the interface I was working on. Instead, I discovered Records as a suitable alternative that closely resembles Java's Maps.
The key question I have is: when should I opt for Typescript's Maps over Records, and vice versa?
What are the distinct functionalities of each?
viewMappings: Record<string, String[]>;
viewMappings: Map<String, String[]>;
For instance,
I presumed these two approaches would behave similarly within my State interface, but they turned out to be quite different. I am seeking detailed documentation on the disparities between the two options.