function forEach(list, callback){
for(var n = ; n <list.length; n++){
callback.call(list[n], n);
}
}
var arr = [,,,,,,,]
forEach(arr, function(index){
if(this == arr[index]){
console.log("Got the expected value of " + arr[index]);
}
})
分享一个代码片段
2021-11-28 21:51:56
function forEach(list, callback){
for(var n = ; n <list.length; n++){
callback.call(list[n], n);
}
}
var arr = [,,,,,,,]
forEach(arr, function(index){
if(this == arr[index]){
console.log("Got the expected value of " + arr[index]);
}
})
分享一个代码片段
下一篇:IOS开发之SWIFT进阶部分