jashkenas/underscore — pull request #1582 by megawac (2014-04-15 19:13:31+00:00)
Title: Abstract iterator binding to createIterator and callbacks to createCallback

- Commit 1: simple optimization for many underscore methods common case with no context. Avoids calling `.call()` and instead calls the function directly whenever possible

- Commit 2 (see #1561): `lookupIterator` maps passed strings to `_.property` (see #1557) and objects to `_.matches` allowing for some functionality thats existed in lodash for some time. It also allows `_.find` to cover `_.findWhere`, `_.filter` to cover `_.where`, `_map` to cover `_.pluck` and essentially adds [`_.rejectWhere`](https://github.com/jashkenas/underscore/pull/1366) as `_.reject`.

There are many side effects of this commit and so I can go grab dinner I'm going to pull examples from lodash docs (see included tests for more examples):

```javascript
var characters = [
{ 'name': 'barney', 'age': 36, 'blocked': false },
{ 'name': 'fred', 'age': 40, 'blocked': true }
];

// using "_.pluck" callback shorthand
_.map(characters, 'name');
// → ['barney', 'fred']

// using "_.pluck" callback shorthand
_.filter(characters, 'blocked');
// → [{ 'name': 'fred', 'age': 40, 'blocked': true }]

// using "_.where" callback shorthand
_.filter(characters, { 'age': 36 });
// → [{ 'name': 'barney', 'age': 36, 'blocked': false }]

_.min(characters, 'age');
// → { 'name': 'barney', 'age': 36, 'blocked': false };

// using "_.where" callback shorthand
_.find(characters, { 'age': 40 });
// → { 'name': 'fred', 'age': 40, 'blocked': true }

// using "_.where" callback shorthand
_.reject(characters, { 'age': 36 });
// → [{ 'name': 'fred', 'age': 40, 'blocked': true }]
```