在此插入代码
function sum(...rest) { var count = 0; rest.forEach(function(element,index,array){ if(typeof element=== 'number'){ count += element; } alert("element:"+element); alert("index:"+index); alert("array:"+array); }); return count; }
Sign in to make a reply
八岛栗子
function sum(...rest) { var count = 0; rest.forEach(function(element,index,array){ if(typeof element=== 'number'){ count += element; } alert("element:"+element); alert("index:"+index); alert("array:"+array); }); return count; }