Might be missing something here, but I think NaN will make it through all the checks and be passed as 0. I'd do the ~~size at the === 0 check.