Last active
November 6, 2018 02:04
-
-
Save ramadani/83f6f97d54c4c6beac814b01312d2509 to your computer and use it in GitHub Desktop.
Create initial name with javascript
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 initialName(name, length) { | |
const parts = name.split(' '); | |
return parts.filter((it, i) => i <= (length - 1)).map(it => it.substring(0, 1)).join(''); | |
}, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment