Created
October 1, 2014 18:55
-
-
Save tlemburg/dcb648bb93b07c6f169a to your computer and use it in GitHub Desktop.
Doing the XOR operator in javascript.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Boolean.prototype.xor = function (other) {return (!this && Boolean(other)) || (this && !Boolean(other))} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment