js reduce 高階函數。 tcp udp

function myReduce(arr,cb){ //簡單模式,沒有初值 let res = arr[0]; for(let i = 1 ;i<arr.length;i++){ const cur = arr[i]; res = cb(res,cur,i,arr); } return res; } https://zhuanlan.zhihu.com/p/24860273
相關文章
相關標籤/搜索