Move this out of the body of `add` (but still in the IIFE of course), make it a declaration (instead of expression) and rename to `isDistinct`.