JS Daily #38 - Adding Two Boolean Values
What is the output of following code?
console.log(true + true);
The output is
When both the operands for
+ is of type Boolean, both the operands are converted to numbers.
true is converted to
false is converted to
0. That is why the result printed as