why not have a default for x & y? !! is a smell
-
-
-
I think ^^ would be nice :)
-
pinging
@BrendanEich, other than historical precedent, is there a reason JS doesn't have logical xor? -
1/ C heritage as u say, but is NO ACCIDENT :-P. YAGNI. 2/ value-preserving ^^ hard. What is '' ^^ 0? '', 0, or false?
-
In JS I'd expect it to preserve value but not short-circuit (both values always needed)
-
so which value wins in the falsy result cases?
End of conversation
New conversation -
-
-
!a != !b
-
this is awesome, is there a proof of this somewhere? from (a || b) && (a !== b)
-
you can always write out the full truth tables and see that they're the same.
-
first thing I did, but was wondering how you came up with it. Wanted to know if there was a derivation from the definition
-
math is equal parts rigor and intuition. Just takes practice.
- 6 more replies
New conversation -
-
-
I am noticing that I write !! in other languages too. That's the heritage of writing JS.
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
I legit needed this in a CP in Ember one time. Gonna write this one down
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.