TS1442

The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression.

Broken Code ❌

const sum = () => {
  return Array.from(arguments).reduce((a, b) => a + b, 0);
};
tsconfig.json
{
  "compilerOptions": {
    "target": "ES5"
  }
}

Fixed Code ✔️

function sum() {
  return Array.from(arguments).reduce((a, b) => a + b, 0);
}
tsconfig.json
{
  "compilerOptions": {
    "target": "ES5"
  }
}

Alternative:

const sum = (...numbers: number[]) => {
  return numbers.reduce((a, b) => a + b, 0);
};
tsconfig.json
{
  "compilerOptions": {
    "target": "ES5"
  }
}

Arrow functions don't have their own arguments object. Use rest parameters or a regular function instead.