mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-02 08:07:50 +00:00
Ensure underscore build internal forOwn will accept a thisArg argument. [closes #220].
Former-commit-id: a7818db29e81b64556232bfe44b2e1275d3dada1
This commit is contained in:
@@ -899,6 +899,18 @@
|
||||
equal(last, _.last(array), '_.forEach should not exit early: ' + basename);
|
||||
equal(actual, undefined, '_.forEach should return `undefined`: ' + basename);
|
||||
|
||||
lodash.forEach([1], function(value, index) {
|
||||
actual = this[index];
|
||||
}, [2]);
|
||||
|
||||
equal(actual, 2, '_.forEach supports the `thisArg` argument when iterating arrays: ' + basename);
|
||||
|
||||
lodash.forEach({ 'a': 1 }, function(value, key) {
|
||||
actual = this[key];
|
||||
}, { 'a': 2 });
|
||||
|
||||
equal(actual, 2, '_.forEach supports the `thisArg` argument when iterating objects: ' + basename);
|
||||
|
||||
array = [{ 'a': [1, 2] }, { 'a': [3] }];
|
||||
|
||||
actual = lodash.flatten(array, function(value, index) {
|
||||
|
||||
Reference in New Issue
Block a user