You can simply use the strict equality operator (===) if you wants to convert a string representing a boolean value, such as, 'true' or 'false' into an intrinsic Boolean type in JavaScript.
Let's take a look at the following example to understand how it basically works:
Use the
===OperatorYou can simply use the strict equality operator (===) if you wants to convert a string representing a boolean value, such as, 'true' or 'false' into an intrinsic Boolean type in JavaScript.
Let's take a look at the following example to understand how it basically works:
need an explanation for this answer? contact us directly to get an explanation for this answer