Given following array:
var arr = [undefined, undefined, 2, 5, undefined, undefined];
I\'d like to get the count of elements which are>
Remove the values then check (remove null check here if you want)
const x = A.filter(item => item !== undefined || item !== null).length
With Lodash
const x = _.size(_.filter(A, item => !_.isNil(item)))