How do i return an object key name only if the value of it is true?
I\'m using underscore and the only thing i see is how to return keys which is easy, i want to avo
If you're trying to combine filtering and iterating over an object you're usually after _.reduce (the Swiss Army Knife iterator):
var trues = _(obj).reduce(function(trues, v, k) { if(v === true) trues.push(k); return trues; }, [ ]);
Demo: http://jsfiddle.net/ambiguous/2et6T/