Skip to content

Instantly share code, notes, and snippets.

@rabidaudio
Created January 24, 2015 16:25
Show Gist options
  • Save rabidaudio/0e358f7c6692b59b90b8 to your computer and use it in GitHub Desktop.
Save rabidaudio/0e358f7c6692b59b90b8 to your computer and use it in GitHub Desktop.
javascript capitalize first letter of every word
function capitalize(sentence){
sentence.split(" ").map(function(e){ var a = e.split(""); a.unshift(a.shift().toUpperCase()); return a.join(""); }).join(" ");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment