Given an array:
var arr = [1,,2,5,6,,4,5,6,,];
Count how many empty values is has: (length - length after removing the empty values)
var empties = arr.length - arr.filter(function(x){ return true }).length;
// return 3
or something like this
arr.empties = arr.length;
arr.forEach(function(x){ arr.empties-- });
// arr.empties returns 3
Is this the best way or am I missing something?