Skip to content

A slight alteration to Rest Syntax section for better understanding #28

Description

@Abdul-Sen

I read through the Rest Syntax section and I felt it was improvement could be made by letting readers know that you can use declared params and rest syntax together. We can either state that ...args has to be the last function argument in text or update the example to the following (or do both 🙂):

function myFunc(param1, ...args) {
    console.log(param1 + args[0] + args[1]);
}

myFunc("The Result is: " , 1, 2, 3, 4);
// The Result is: 3

I'd be happy to make the pull request.

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