function sum(...rest) {
var s1=0;
if (arguments.length===0){console.log("请输入!")}
rest.forEach(function(a){
if(typeof(a)!=="number"){console.log(a+'不是数字');return 1}
s1=s1+a;
})
return s1
}
Sign in to make a reply
那年今日34
function sum(...rest) {
var s1=0;
if (arguments.length===0){console.log("请输入!")}
rest.forEach(function(a){
if(typeof(a)!=="number"){console.log(a+'不是数字');return 1}
s1=s1+a;
})
return s1
}