Skip to content

area for clarification - Spread Operator #3

@robin-raymond

Description

@robin-raymond
list.push(...toAdd);

I totally get why the ... is needed in the other examples for their sugar to work, but this one baffled me. I'm sure there are "reasons" but I find it strange why a list would need to use the ... to indicate a push of multiple entries to a function like push. This small bit could be clarified. You would think strong typing would implicitly make it understood given the context. Maybe I'm not understanding properly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions