Created
January 7, 2018 03:01
-
-
Save jhsuZerion/9eb9e26f30e8919830dc919f26ee3b0c to your computer and use it in GitHub Desktop.
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
/** | |
* Build full name based on three string values, will not double space | |
* @param {string} f first name | |
* @param {string} m middle name | |
* @param {string} l last name | |
* @return {string} three strings joined by space | |
*/ | |
function makePersonFullName(f,m,l) { | |
var full_name = []; | |
if(typeof f === "string" && f.trim().length > 0) { full_name.push(f); } | |
if(typeof m === "string" && m.trim().length > 0) { full_name.push(m); } | |
if(typeof l === "string" && l.trim().length > 0) { full_name.push(l); } | |
return full_name.join(" "); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment