Function isBool

  • Checks if a value is a boolean.

    Parameters

    • val: unknown

      The value to be checked.

    Returns val is boolean

    true if the value is a boolean, false otherwise.

    Example

    const value1 = true;
    const value2 = false;
    const value3 = 1;

    console.log(isBool(value1)); // true
    console.log(isBool(value2)); // true
    console.log(isBool(value3)); // false

Generated using TypeDoc