Discuss / JavaScript / 第一题

第一题

Topic source
function sum(...rest) {
    let result = 0;
    rest.forEach(n => {
        result += n;
    })
    return result;
}

不响丸辣

#2 Created at ... [Delete] [Delete and Lock User]

function sum(...rest) {

var c=0

 rest.map((a,b)=>{

return c+=a

}

)

return c

}


  • 1

Reply