Last active
August 29, 2015 13:57
-
-
Save hankyates/9680217 to your computer and use it in GitHub Desktop.
Code Fellows XOR
This file contains 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
// Implement an exclusive OR function called `preferredName` that has the following interface: | |
var FirstName, | |
LastName; | |
preferredName(FirstName, LastName); | |
// -> false | |
FirstName = 'Hank'; | |
preferredName(FirstName, LastName); | |
// -> 'Hank' | |
LastName = 'Yates'; | |
preferredName(FirstName, LastName); | |
// -> false | |
FirstName = ''; | |
preferredName(FirstName, LastName); | |
// -> 'Yates' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment