Capitalize each word
EasyStrings · JavaScript
The task
Write capitalizeWords(s) that returns s with the first letter of every word in upper case and the rest in lower case.
Words are separated by single spaces.
Examples
- capitalizeWords("hello big world") returns "Hello Big World"
Your code runs in your browser, in a separate worker, and is never sent to us. Edit the function, then press Run tests. Your work is saved here as you type.
JavaScriptCtrl or Cmd + Enter to run