Is there some elegant way of filtering out falsey properties from this object with lodash/underscore? Similar to how _.compact(array) removes falsey elements fr
_.compact(array)
let temp = { propA: true, propB: true, propC: false, propD: true, } let obj = {} for(x in temp){ if(temp[x] == true){ obj[x] = temp[x] } } console.log(obj)
Using for-in loop we can achieve it something like this.