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

Use splats #2

Closed
anodynos opened this issue Jul 4, 2016 · 3 comments
Closed

Use splats #2

anodynos opened this issue Jul 4, 2016 · 3 comments
Assignees

Comments

@anodynos
Copy link

anodynos commented Jul 4, 2016

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 :-)

@akanass
Copy link
Owner

akanass commented Jul 4, 2016

Yes, I can use spread operator but when I wrote this library, NodeJS didn't allowed this feature.

I must check if it's OK now.

@akanass akanass self-assigned this Jul 4, 2016
@anodynos
Copy link
Author

anodynos commented Jul 8, 2016

Oh, you're not babelify-ing it :-/
I thought you were (this should be another issue:)

BTW, you should if you want it to run on older nodejs's out there...

@akanass
Copy link
Owner

akanass commented Sep 29, 2016

Done

@akanass akanass closed this as completed Sep 29, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants