Skip to content

Empty Object and/or Array #7

@LetsMelon

Description

@LetsMelon

Question

Should this behaviour (see examples) be fixed?

Examples

1. addIdToArray([])

addIdToArray([]);
// --> []

2. addIdToArray([{}, {}])

addIdToArray([{}, {}]);
// --> [ { id: 1 }, { id: 2 } ]

3. addIdToArray([[], []])

addIdToArray([[], []]);
// --> [ { id: 1 }, { id: 2 } ]

4. addIdToArray(undefined)

addIdToArray(undefined);
// --> [ { id: 1 } ]

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinghelp wantedExtra attention is neededinvalidThis doesn't seem right

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions