in reply to remove duplicates from array

Unfortunately, ternary and modulus return incorrect results when the array contains 0. ternary pushes an extra 0 into the results, because the conditional operator doesn't distinguish between 0 and undef.

If 0 is the first element in the array, modulus omits it from the results. If the array starts with a negative integer and contains 0, modulus tries to divide by zero and dies horribly.

These solutions could be fixed with some extra conditionals, but I think the other solutions are better.