Skip to content
This repository was archived by the owner on May 11, 2021. It is now read-only.
This repository was archived by the owner on May 11, 2021. It is now read-only.

Use splats  #2

@anodynos

Description

@anodynos

You can use splats (copied from http://coffeescript.org/) in ES6 - so

var myFun = function (
// create new args array
    const args = new Array(arguments.length);

    // inserts arguments inside
    Object.keys(arguments).forEach((key, index) => args[index] = arguments[key]);
}

simply becomes

var myFun = function (...args) {}

and no comments are needed :-)

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions