* The opposite of `_.initial` this method gets all but the first element or * first `n` elements of an array. If a callback function is provided elements * at the beginning of the array are excluded from the result as long as the * callback returns truey. The callback is bound to `thi
(array, callback, thisArg)
| 39971 | * // => [{ 'name': 'pebbles', 'blocked': true, 'employer': 'na' }] |
| 39972 | */ |
| 39973 | function rest(array, callback, thisArg) { |
| 39974 | if (typeof callback != 'number' && callback != null) { |
| 39975 | var n = 0, |
| 39976 | index = -1, |
| 39977 | length = array ? array.length : 0; |
| 39978 | |
| 39979 | callback = lodash.createCallback(callback, thisArg, 3); |
| 39980 | while (++index < length && callback(array[index], index, array)) { |
| 39981 | n++; |
| 39982 | } |
| 39983 | } else { |
| 39984 | n = (callback == null || thisArg) ? 1 : nativeMax(0, callback); |
| 39985 | } |
| 39986 | return slice(array, n); |
| 39987 | } |
| 39988 | |
| 39989 | /** |
| 39990 | * Uses a binary search to determine the smallest index at which a value |