I'm trying to compare to boolean value in a if.
I would like to do something like this:
value1 = false;
value2 = true;
if (value1 === value2) {
... Some code ...
}
In JAVA you can use Boolean.compare(boolean a, boolean b), but I can't find something equal in TypeScript.
For context, Boolean.compare(boolean a, boolean b) returns:
- 0 if
ais equal tob, - a negative value if
ais false andbis true, - a positive value if
ais true andbis false.
Thanks for you help
Edited: to show the message I get
This condition will always return 'false' since the types 'true' and 'false' have no overlap
