@mindblender 
Possibly use _.isUndefined() method to test for an empty string. This is a possible change for a cleaner implementation but what you have is not incorrect.