Don't use arguments object in Arrow functions
· ☕ 1 min read
Arguments object throws an error when used with arrow functions.
Consider this code -
1 2 3 4 5 6 function getSum() { return arguments[0] + arguments[1]; } console.log(getSum(1, 2)); // 3 The result is as expected. But, you cannot do the same using an arrow function.