Last active
March 18, 2018 15:08
-
-
Save gerlacdt/9775d6ab24da64df2fa1a57c40c3e1a0 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
function getNickname(fullname) { | |
return fullname | |
.split(/\s+/) | |
.map(n => n.substring(0,3)) | |
.join(''); | |
} | |
const result = getNickname('Daniel Gerlach'); | |
console.log(result); // => DanGer | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment