Just above where the sort animation code is add this code.
We simply need to get the existing count of the animateArray and elementItems Arrays.
var shown = animateArray.length ;
var hidden = elementItems.length ;
console.log("shown " + shown);
console.log("hidden " + ( hidden - shown));
//-- SORT ANIMATION array