These two tips can help you to decide whether to use a Map or an Object:
Use maps over objects when keys are unknown until run time, and when all keys are the same type and all values are the same type.
Use maps in case if there is a need to store primitive values as keys because object treats each key as a string either its a number value, boolean value or any other primitive value.
Use objects when there is logic that operates on individual elements.