1. function arr() { 2. var s = 0; 3. for (var i = 0; i < arguments.length; i++) { 4. s = s + arguments[i]; 5. } 6. 7. return s; 8. } 9. 10. var res = arr(1,2,3,3,4,5); 11. 12. document.write(res);
1. function arr() { 2. var s = 0; 3. for (var i = 0; i < arguments.length; i++) { 4. s = s + arguments[i]; 5. } 6. 7. return s; 8. } 9. 10. var res = arr(1,2,3,3,4,5); 11. 12. document.write(res);