From man bash:
for name [ [ in [ word ... ] ] ; ] do list ; done
...
If the "in word" is omitted, the for command executes list oncefor each positional parameter that is set
In reality, it will do the same as this:
for e in "$@"; do
After the command shift
, only the array elements remain in the positional parameters, which the for
loop iterates over.