akanass/rx-http-request

Use splats

Closed this issue · 3 comments

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

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.

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...

Done