Because you're removing the very elements that you're iterating over, the iteration ends up in the wrong place. That is, you look at the first one and then remove it, and then try to look at the second one. But the one that had been the second one is now the first one, so that one gets skipped.
The solution, as CBroe says, is to run the loop from high to low, so that you're not trying to count things that already have been removed:
for (var i=ads.length-1; i>=0; i--)