Closed
Description
Currenty the function like this:
const foo = (...args: any[]): void => {
}
is transpiled into
var foo = function () {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i - 0] = arguments[_i];
}
};
You may notice that zero subtraction in the args[_i-0]
part is useless.
My proposal is to drop it and use just args[_i]
in cases when the function signature consists only of spread.
This small change won't affect the generated code behavior, but would make it slightly more readable and compact.
You can preview the results here, and here's the proposed change