Best way to “negate” an instanceof September 14, 2022 by Tarik No, there is no better way; yours is canonical.