There's a question here which is similar but is specific to "when keys are unknown at runtime".
The MDN docs for Map state:
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 objects when there is logic that operates on individual elements.
I understand the advice about using maps "when keys are unknown until run time".
I'm confused by the line "when all keys are the same type and all values are the same type". What are they trying to suggest there? I mean, if all my keys are not of the same type, am I not forced to use Map anyway as it supports keys of different types? Also, why should the types of the values determine whether I use a Map or Object?
Also, I don't really understand "Use objects when there is logic that operates on individual elements." Could someone give me an example of what they mean by that?