In ES6, it's possible to use ...arguments
to pass all arguments of one function to another, e.g.
function foo(a, b) {
return bar(...arguments);
}
function bar(a, b) {
return a + b;
}
foo(1, 2); // returns 3
I "discovered" this idiom myself, and am wondering if there are any downsides to it, or whether it's considered a bad practice?