DEV Community

loading...

Discussion on: When You Should Use JavaScript Maps over Objects

Collapse
pentacular profile image
pentacular

Objects also tend to be optimized for having a common schema.

V8 will organize objects with the same structure into virtual classes.

Having unique structures is then penalized.

So I'd say that objects for regularly structured data and maps for irregular or unstructured data is probably right.