JavaScript 2025 · Strings
Capitalize a word
Uppercase the first letter and keep the rest.
const title = word[0].toUpperCase() + word.slice(1);
Official JavaScript 2025 documentation
JavaScript 2025 · Strings
Uppercase the first letter and keep the rest.
const title = word[0].toUpperCase() + word.slice(1);
Official JavaScript 2025 documentation
Was this page helpful?