Created
May 9, 2020 12:00
-
-
Save iceener/345bc04851bc42c82aa1a152ce161df9 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
// Capitalize all words of a string | |
function capitalize(string) { | |
return string.replace(/\b[a-z]/g, (char) => char.toUpperCase()); | |
} | |
capitalize('overment rocks!'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment