I have this array:
[null, {name:\'John\'}, null, {name:\'Jane\'}]
I want to remove the null values. Is there an easy way to do this with unders
If the array contains either nulls or objects then you could use compact:
var everythingButTheNulls = _.compact(list);
NB compact removes all falsy values so if the array could contain zeros, false etc then they would also be removed.
Could also use reject with the isNull predicate:
var everythingButTheNulls = _.reject(array, _.isNull);