IRHydra2 is pretty good for it but has a learning curve.
There is really no need for the arguments object in a world with default and rest parameters, and it has always been an obstacle to performance, so I'm glad arrow functions don't use it.
There is really no need for the arguments object in a world with default and rest parameters, and it has always been an obstacle to performance, so I'm glad arrow functions don't use it.
Also, changing that example to use rest parameters:
function foo() {
const bar = (...abc) => {
console.log(abc);
console.log(arguments);
};
bar('a', 'b', 'c');
}
SyntaxError: 'arguments' object may not be used in conjunction with a rest parameter
...which, okay, hmmm, it's sort of attempting to help me avoid confusion here. But that...was not what I was expecting. It's really weird that all of a sudden, just by adding a rest parameter to my function, a reference to `arguments` becomes invalid syntax. foo(1, 2, 3)
// ["a", "b", "c"]
// [1, 2, 3]
And this is what I get from https://babel.io/repl : 'use strict';
function foo() {
var _arguments = arguments;
var bar = function bar() {
for (var _len = arguments.length, abc = Array(_len), _key = 0; _key < _len; _key++) {
abc[_key] = arguments[_key];
}
console.log(abc);
console.log(_arguments);
};
bar('a', 'b', 'c');
}