mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-07 10:07:48 +00:00
Reduce _.forEach and optimize the minified builds for Safari.
Former-commit-id: d4366f1a3c5fd0751558f714384600c3bcf0f49b
This commit is contained in:
@@ -1725,13 +1725,10 @@
|
||||
* // => alerts each number value (order is not guaranteed)
|
||||
*/
|
||||
function forEach(collection, callback, thisArg) {
|
||||
if (isArray(collection)) {
|
||||
if (callback && typeof thisArg == 'undefined' && isArray(collection)) {
|
||||
var index = -1,
|
||||
length = collection.length;
|
||||
|
||||
if (!callback || typeof thisArg != 'undefined') {
|
||||
callback = createCallback(callback, thisArg);
|
||||
}
|
||||
while (++index < length) {
|
||||
if (callback(collection[index], index, collection) === indicatorObject) {
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user