When using logical operators on non-boolean values, is the return value not boolean?

Viewed 31

For example, in Python, if I do 0 and 2 it would return 0 instead of False.

In JavaScript, if I do "Hello" || "world" it would return "Hello" instead of true.

Aren't logical operators supposed to return a boolean value?

0 Answers
Related