function sum(){ let result = 0, max = arguments.lenght; for (var i = 0; i < max; i++){ return += arguments[i]; } return result; }
function sum(){ var result = 0, max = arguments.length; for (var i = 0; i < max; i++){ result += arguments[i]; } return result ; } alert(sum(1,2,3,4,5))