Per this link, we know
console.log(false ** false == true); // true
console.log(false ** true == false); // true
console.log(true ** false == true); // true
console.log(true ** true == true); // true
I think we can implement Converse implication through exponentiation operator
in ES7.
Given the return value of function f()
and g()
are boolean
. So we can use this simple codes
if (g() ** f()) {
//
}
to replace
if ((g() && f()) || !f()) {
//
}
Some test codes are here. Is it valid or not under ES7?