The isBoolean
function from the underscore library is used to check whether a given value is a boolean or not. Below is an example of how to use the isBoolean
function:
index.tsx331 chars9 lines
In the above example, we are importing the underscore library using require
and then using the isBoolean
function to check whether a given value is a boolean or not. We are passing different types of values to the isBoolean
function and checking the output.
The output will be true
if the given value is a boolean, otherwise false
.
gistlibby LogSnag