Use splats
Closed this issue · 3 comments
anodynos commented
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 commented
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.
anodynos commented
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 commented
Done