Condensed the code a little.

Ok so I condensed my if else statement. Because it's an exclusive or statement instead of a regular or statement, I had to take away the option of both FirstName and LastName being true. I did that in the if statement, and made it a regular or statement in the else part.
The problem is on this line.

Your code passes all tests except when both variables are undefined. This means if I put this into the console:
var firstName; 
var lastName;
preferredName(firstName, lastName);
I get back 'undefined' when I should be getting back false.

You are on the right track though.