标签:
任意数求和:
function sum(){ var total = null; for(var i=0;i<arguments.length;i++){ var cur = Number(arguments[i]); if(isNaN(cur)){ continue; } total+=cur; } return total; } var total = sum(1,2,3,4,5,6); console.log(total);
标签:
原文地址:http://www.cnblogs.com/han6054/p/5343387.html