isBoolean
Check if the given value
is a boolean
.
isBoolean
method to verify the parameter type, avoiding errors caused by passing non - boolean values.v
(any
): The value to test if it is a boolean.v is boolean
): Returns true
if the value is a boolean, otherwise returns false
.