Skip to content
This repository was archived by the owner on Nov 27, 2023. It is now read-only.
This repository was archived by the owner on Nov 27, 2023. It is now read-only.

Output an Object vs a Map #12

Closed
Closed
@bmeck

Description

@bmeck

With a Map, grouping don't have to be on key compatible types and avoids coercions:

o = {};
o[1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000] = 1;
Object.keys(o); // ["1e+90"]

Using an object knowledge of key coercion might be a bit odd.

Problems with Map are usability on reading data out of the Map not being simple property access though but you can always Object.fromEntries(map).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions