Refer to this, the exponentiation operator
returns the result of raising first operand to the power second operand, like the exponentiation operator in Python, which is part of the ECMAScript 2016 (ES7) proposal.
We know the result of Boolean
with exponentiation operator
in Python as following:
>>> False ** False == True
True
>>> False ** True == False
True
>>> True ** False == True
True
>>> True ** True == True
True
I want to know whether the Boolean
could be used in the exponentiation operator
? If so, could the same behavior as above in Python?