forEach = function( ary, fn ){ for ( var i = 0, l = ary.length; i < l; i++ ){ var c = ary[ i ]; if ( fn.call( c, i, c ) === false ){ return false; } }}forEach([1,2,3],function(i,el){ console.log(i,el);});
為什么要加個(gè)call,個(gè)人覺(jué)得多此一舉
qq_花開(kāi)花謝_0
2018-08-09 11:10:47