function isBoolean(x: unknown): x is boolean {
return typeof x === 'boolean'
}
isBoolean(true) // β true
isBoolean(1) // β falsetypeof x === 'boolean' checks for exactly true or false, not truthy/falsy values.
Challenge: Implement isBoolean(x: unknown): x is boolean.
isBoolean(true) // β true
isBoolean(false) // β true
isBoolean(1) // β false (1 is truthy, not boolean)