Is there a better way to do this in lodash? I am basically trying to find all the keys that have null values.
var data = [
{ user: 'John', pos: null },
{ user: 'Tim', age: 40 },
{ user: 'Dave', age: null }
];
$scope.parsed = [];
_.each(data, function(obj) {
_.each(_.keys(obj), function(k){
if (obj[k] === null) {
$scope.parsed.push(k);
}
})
});
console.info($scope.parsed);
Output: ["pos","age"]
Thanks!
angular.forEach