MCPcopy
hub / github.com/jashkenas/underscore / predicate

Function predicate

test/collections.js:931–931  ·  view source on GitHub ↗
(x)

Source from the content-addressed store, hash-verified

929
930 // Context
931 var predicate = function(x){ return x === this.x; };
932 assert.deepEqual(_.partition([1, 2, 3], predicate, {x: 2}), [[2], [1, 3]], 'partition takes a context argument');
933
934 assert.deepEqual(_.partition([{a: 1}, {b: 2}, {a: 1, b: 2}], {a: 1}), [[{a: 1}, {a: 1, b: 2}], [{b: 2}]], 'predicate can be object');

Callers 15

findKeyFunction · 0.85
filterFunction · 0.85
everyFunction · 0.85
someFunction · 0.85
findKeyFunction · 0.85
filterFunction · 0.85
everyFunction · 0.85
someFunction · 0.85
findKeyFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…