The case is simple - I\'ve got a following object:
Object {1: false, 2: true, 3: false, 4: false, 5: false, 6: false, 7: false, 8: true, 12: false, 13: false, 14
My version:
var list = {
1: false, 2: true, 3: false, 4: false,
5: false, 6: false, 7: false, 8: true,
12: false, 13: false, 14: false, 15: false,
16: false, 17: false, 18: false, 19: false
};
_.chain(list).map(function(val, key) {
return val ? parseInt(key) : undefined
}).reject(function(val) {
return _.isUndefined(val);
}).value();
// returns [2,8]