Skip to content

Instantly share code, notes, and snippets.

@anova
Created September 26, 2020 08:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anova/98ccd12bf488230f821c0afe983ece8d to your computer and use it in GitHub Desktop.
Save anova/98ccd12bf488230f821c0afe983ece8d to your computer and use it in GitHub Desktop.
Name Surname -> N. S.
function shortenName(name) {
return name.split(' ').map(word => `${word.charAt(0)}.`).join(' ');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment