It's not magic:
Functions in JS can always accept any number of inputs. The names those inputs may be given are relevant only within the function itself.
some simply calls the function with the relevant values for each element. This is mentioned on the page Turan linked.Functions in JS can always accept any number of inputs. The names those inputs may be given are relevant only within the function itself.