The arguments Object
In short: inside a regular function, arguments is an automatic,
array-like object holding every value the call actually passed — even
ones with no matching named parameter. It has a .length and numeric
indices, but it isn't a real array (no .map, no .filter directly).
Arrow functions have no arguments of their own — they see the
arguments of whatever regular function encloses them, if any. Modern
code usually prefers rest parameters (...args) instead, which are real
arrays.

Catching every value passed, named or not
arguments doesn't care how many parameters you declared — it holds what
was actually sent:
a and b fill the first two slots, as usual. But arguments isn't
limited to named parameters — it has all four values, [10, 20, 30, 40],
because that's what the call sent, regardless of what the function
signature promised to use.
Summing an unknown number of arguments
Before rest parameters existed, arguments was how you wrote a function
that accepts any number of values:
No parameters are declared at all — total() works purely off
arguments, looping through however many values a particular call
happens to pass.
Arrow functions silently borrow the wrong arguments
The trap isn't that an arrow function without arguments errors out — it's
that it silently reaches outward and picks up whatever arguments
happens to be in scope, which is very often not what you meant:
makeLogger("a") returns an arrow function. That arrow has no arguments
of its own, so every time it runs, arguments means makeLogger's —
frozen at 1, from the call that created it. Calling logger(1, 2, 3)
later doesn't change that: the 1, 2, 3 never reach an arguments
object at all, because there isn't one for this call. Rest parameters
(...args) fix this properly: args belongs to the arrow itself, built
fresh from whatever that specific call passed in.
Reach for ...args in any function — arrow or not — that needs "every
value passed in." It's a real array, and it's never borrowed from
somewhere else by accident.
Quick practice
function f(a, b) { return arguments.length; } called as f(1, 2, 3, 4) — what does it return?
Is arguments a real JavaScript array?
function makeLogger() { return () => arguments.length; } — what does makeLogger("a")(1, 2, 3) return?
