mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-04 08:57:49 +00:00
Bump to v3.7.0.
This commit is contained in:
@@ -1,5 +1,8 @@
|
||||
define(['./bindCallback', '../lang/isArray'], function(bindCallback, isArray) {
|
||||
|
||||
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
|
||||
var undefined;
|
||||
|
||||
/**
|
||||
* Creates a function for `_.forEach` or `_.forEachRight`.
|
||||
*
|
||||
@@ -10,7 +13,7 @@ define(['./bindCallback', '../lang/isArray'], function(bindCallback, isArray) {
|
||||
*/
|
||||
function createForEach(arrayFunc, eachFunc) {
|
||||
return function(collection, iteratee, thisArg) {
|
||||
return (typeof iteratee == 'function' && typeof thisArg == 'undefined' && isArray(collection))
|
||||
return (typeof iteratee == 'function' && thisArg === undefined && isArray(collection))
|
||||
? arrayFunc(collection, iteratee)
|
||||
: eachFunc(collection, bindCallback(iteratee, thisArg, 3));
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user