| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | 1 1 8 8 18 7 8 1 | define(['./forOwn'], function(forOwn) {
/**
* Creates a new object with all the properties where the callback returns
* true.
* @version 0.1.0
*/
function filterValues(obj, callback, thisObj) {
var output = {};
forOwn(obj, function(value, key, obj) {
if (callback.call(thisObj, value, key, obj)) {
output[key] = value;
}
});
return output;
}
return filterValues;
});
|