Library API
    Preparing search index...

    Function nullishToZero

    • Returns the value if defined, otherwise 0.

      Type Parameters

      • T

      Parameters

      • obj: T

        The value to check

      Returns 0 | NonNullable<T>

      The value or 0

      const val = nullishToZero(null); // 0