isBoolean

Modified on Mon, 21 Aug 2023

Description

Use this function to check if a value is classified as a boolean primitive or object.

Syntax

isBoolean(value)

Returns

Return ValueDescription
True/FalseReturns true if the given value is a boolean and false otherwise.

Sample

ExampleResultDescription
isBoolean(true)trueReturns true if the given value is a boolean, in this case, it returns true because true is a boolean value.
isBoolean('hello')falseReturns false if the given value is not a boolean, in this case, it returns false because 'hello' is not a boolean value.

To view all the Language functions, click here.