5 ms·
e.metaKey is the `⌘Command` key on Mac (used for the save shortcut), an entirely different key than the ones involved in the bug. Also, Javascript doesn't have
by LordDragonfang 5y ago
e.metaKey is the `⌘Command` key on Mac (used for the save shortcut), an entirely different key than the ones involved in the bug.
Also, Javascript doesn't have a logical xor operator, so trying to do that would potentially reduce readability.
- joshuaissac 5y ago> Javascript doesn't have a logical xor operator x != y
- dhosek 5y agoAlthough with the looseness around booleans in JS, I'd imagine that you might need to do something more like `(x==true) != (y==true)`
- LordDragonfang 5y agoA common hack, and that's where the "potentially reduce readability" caveat comes in.
- smlckz 5y ago> Also, Javascript doesn't have a logical xor operator, so trying to do that would potentially reduce readability. I also didn't know about any operator to logically xor two boolean variables (thought about (ab)using JavaScript's implicit type conversion mechanisms: `x ^ y`), and then I learnt that `!=` works fine as a logical xor for booleans. Tada! I don't know how much readability is reduced by this.