1var user = {
2 "first_name":"taylor",
3 "last_name":"hawkes",
4 "full_name": "taylor hawkes"
5};
6
7var userCleaned = _.pickBy(user, function(value, key) {
8 return (key === "first_name" || key === "last_name");
9});
10
11//userCleaned is now:
12//{
13// "first_name": "taylor",
14// "last_name": "hawkes"
15//}
1const arr = [
2 {},
3 { hello: null },
4 { hello: false },
5 { hello: 0 },
6 { hello: 'world' }
7];
8
9_.filter(arr, 'hello'); // [{ hello: 'world' }]