javascript回调函数例子(addOne是回调函数)
function addOne(a){ return a+1; } function calcNum(a,b,c,callback){ var i,arr=[]; for(var i=0;i<3;i++){ arr[i]=callback(arguments[i]*2); } return arr; } alter(calcNum(5,6,7,addOne))
2023-07-24 11:21:52
javascript回调函数例子(addOne是回调函数)
function addOne(a){ return a+1; } function calcNum(a,b,c,callback){ var i,arr=[]; for(var i=0;i<3;i++){ arr[i]=callback(arguments[i]*2); } return arr; } alter(calcNum(5,6,7,addOne))