Why is it that when I do
(!true) ? 'false' : 'true'
it returns 'true'?
It simply means
if (!true) {
return 'false';
} else {
return 'true';
}
!true (not true) means false, so the else is returned.
Because (!true) is false, and then the right side of the : is chosen.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With