|
12 | 12 | assert.deepEqual(_.first([1, 2, 3], 5), [1, 2, 3], 'returns the whole array if n > length'); |
13 | 13 | var result = (function(){ return _.first(arguments); }(4, 3, 2, 1)); |
14 | 14 | assert.strictEqual(result, 4, 'works on an arguments object'); |
15 | | - result = _.map([[1, 2, 3], [1, 2, 3]], _.first); |
16 | | - assert.deepEqual(result, [1, 1], 'works well with _.map'); |
| 15 | + result = _.map([[1, 2, 3], [], [1, 2, 3]], _.first); |
| 16 | + assert.deepEqual(result, [1, void 0, 1], 'works well with _.map'); |
17 | 17 | assert.strictEqual(_.first(null), void 0, 'returns undefined when called on null'); |
18 | 18 | assert.deepEqual(_.first([], 10), [], 'returns an empty array when called with an explicit number of elements to return'); |
19 | 19 | assert.deepEqual(_.first([], 1), [], 'returns an empty array when called with an explicit number of elements to return'); |
|
70 | 70 | assert.deepEqual(_.last([1, 2, 3], 5), [1, 2, 3], 'returns the whole array if n > length'); |
71 | 71 | var result = (function(){ return _(arguments).last(); }(1, 2, 3, 4)); |
72 | 72 | assert.strictEqual(result, 4, 'works on an arguments object'); |
73 | | - result = _.map([[1, 2, 3], [1, 2, 3]], _.last); |
74 | | - assert.deepEqual(result, [3, 3], 'works well with _.map'); |
| 73 | + result = _.map([[1, 2, 3], [], [1, 2, 3]], _.last); |
| 74 | + assert.deepEqual(result, [3, void 0, 3], 'works well with _.map'); |
75 | 75 | assert.strictEqual(_.last(null), void 0, 'returns undefined when called on null'); |
76 | | - |
77 | 76 | assert.deepEqual(_.last([], 10), [], 'returns an empty array when called with an explicit number of elements to return'); |
78 | 77 | assert.deepEqual(_.last([], 1), [], 'returns an empty array when called with an explicit number of elements to return'); |
79 | 78 | assert.deepEqual(_.last(null, 5), [], 'returns an empty array when called with an explicit number of elements to return'); |
|
0 commit comments