assignment 2.2 Exclusive OR

This is what I came up with on my own. Below is what I understand Martin showing in class.

var preferredName = function (firstName, lastName);
     return (!firstName === !lastName) ? false : (firstName || lastName) };
So this should actually return firstName if firstName is specified, lastName if lastName is specified and false if either both or neither is specified.