Reputation: 3747
In Javascript, is
return (someBooleanValue == true)
necessarily always the same as
return someBooleanValue
?
Upvotes: 0
Views: 34
Reputation: 664195
If you assume that typeof someBooleanValue
is 'boolean'
, then Yes these are equivalent (by pure boolean logic).
For everything else, they are not.
Upvotes: 1
Reputation: 4619
Iff someBooleanValue
is a boolean value, then yes. For any other object/value, then no.
Upvotes: 1