libs/lodash.js
function createCallback(func, thisArg, argCount) {
      var type = typeof func;
      if (type == 'function' || func == null) {
        return (typeof thisArg == 'undefined' || !('prototype' in func)) &&
          func || baseCreateCallback(func, thisArg, argCount);
      }
      // handle "_.pluck" and "_.where" style callback shorthands
      return type == 'object' ? matches(func) : property(func);
    }
function createCallback(func, thisArg, argCount) {
      var type = typeof func;
      if (type == 'function' || func == null) {
        return (typeof thisArg == 'undefined' || !('prototype' in func)) &&
          func || baseCreateCallback(func, thisArg, argCount);
      }
      // handle "_.pluck" and "_.where" style callback shorthands
      return type == 'object' ? matches(func) : property(func);
    }
function createCallback ( func , thisArg , argCount ) { var type = typeof func ; if ( type == 'function' || func == null ) { return ( typeof thisArg == 'undefined' || ! ( 'prototype' in func ) ) && func || baseCreateCallback ( func , thisArg , argCount ) ; } // handle "_.pluck" and "_.where" style callback shorthands return type == 'object' ? matches ( func ) : property ( func ) ; }
Creates a function bound to an optional `thisArg`. If `func` is a property
name the created callback will return the property value for a given element.
If `func` is an object the created callback will return `true` for elements
that contain the equivalent object properties, otherwise it will return `false`.

@static
@memberOf _
@alias callback
@category Utilities
@param {*} [func=identity] The value to convert to a callback.
@param {*} [thisArg] The `this` binding of the created callback.
@param {number} [argCount] The number of arguments the callback accepts.
@returns {Function} Returns the new function.
@example

var characters = [
{ 'name': 'barney', 'age': 36 },
{ 'name': 'fred',   'age': 40 }
];

// wrap to create custom callback shorthands
_.createCallback = _.wrap(_.createCallback, function(func, callback, thisArg) {
var match = /^(.+?)__([gl]t)(.+)$/.exec(callback);
return !match ? func(callback, thisArg) : function(object) {
return match[2] == 'gt' ? object[match[1]] > match[3] : object[match[1]] < match[3];
};
});

_.filter(characters, 'age__gt38');
// => [{ 'name': 'fred', 'age': 40 }]
Creates a function bound to an optional thisArg . If func is a property name the created callback will return the property value for a given element . If func is an object the created callback will return true for elements that contain the equivalent object properties otherwise it will return false .