firstly, js do not check argument count : you can call any function with any amount of arguments.
Secondly, declaring a function means the same thing as declaring , so for a js engine, your code is
var call = fun1
var call = fun2
is the same as
var call
......
call = fun1
call = fun2
For function definitions, the value will also be hoisted, so it is actually
var call = fun2
......
so, it will always be the later one.
If you want to access all arguments in a normal function, you can use arguments
, or do this
function f(foo, bar, ...args) {...}
in arrow function there is no arguments