Example 1 — Official Four Shorthands
Null, function, object, and string each become a usable callback.
var person = { firstName: 'Chelsea', age: 30 };
_.iteratee()(person) === person; // true
_.iteratee(function (n) { return n * 2; })(4); // 8
_.iteratee({ firstName: 'Chelsea' })(person); // true
_.iteratee('firstName')(person); // "Chelsea" How It Works
- No value. Returns
_.identity— same object back. - Function. Your function is used as-is (
4 → 8). - Object. Becomes a matcher for those key/value pairs.
- String. Becomes a property reader for
firstName.

