Skip to content

Consolidation behavior #18

Open
Open
@gibson042

Description

@gibson042

Should the unique operation keep the first value with a given surrogate key or the last, and at what index? Is there reason to make it author-configurable?

const data = [
    { id: 1, name: "1a" },
    { id: 2, name: "2a" },
    { id: 1, name: "1b" },
];
data.uniqueBy(v => v.id)[0].name; // ???

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions