Function isPrimitive

  • Checks if the provided value is a primitive type (null, undefined, bigint, boolean, number, string or symbol).

    Parameters

    • value: unknown

      The value to check.

    Returns value is TPrimitive

    A boolean indicating whether the provided value is a primitive type.

    Example

    isPrimitive(123);
    //=> true
    isPrimitive({});
    //=> false

Generated using TypeDoc