this code does work.
you are not passing the function an array. You are passing in several parameters.
console.log( ArrayAddition( [1,2,3,4,5] )
when you do this
console.log( ArrayAddition( 1,2,3,4,5 )
the function takes the first parameter 1 and uses that number as your arr variable. Thus returning 0 because numbers have no length, the loop does not trigger.
someFunction( param1, param2, param3, param4, param5 .....paramN )