Anatoli Papirovski aefbb1380e No unneeded empty arrays in transform spread (#6763)
* No unneeded empty arrays in transform spread

Since Array.prototype.concat creates a new array from inputs, there's
no need to call it from a new empty array ([].concat()).

* [fixup] simplify detection of new array
2017-11-09 14:51:56 -05:00

8 lines
172 B
JavaScript

function foo() {
for (var _len = arguments.length, bar = new Array(_len), _key = 0; _key < _len; _key++) {
bar[_key] = arguments[_key];
}
return bar.concat();
}