By the end of this tutorial, you’ll use Lodash’s _.startCase() confidently in real JavaScript projects.
01
Core syntax
_.startCase(string)
02
Title words
Capitalize each word
03
UI labels
Keys to headings
04
snake input
Underscore boundaries
05
vs capitalize
One word vs all words
06
Production tips
Acronym caveats
Fundamentals
What Is _.startCase()?
_.startCase() transforms strings into Start Case—each word capitalized and separated by spaces. It turns machine-friendly keys like product_description into readable labels like Product Description.
💡
Beginner tip
Use _.startCase('hello world') for display text, not for variable names—use _.camelCase() for identifiers.
Foundation
📝 Syntax
javascript
_.startCase([string=''])
Syntax Rules
string — Input to transform (defaults to empty string).
Word split — Splits on spaces, underscores, hyphens, and case transitions.
Casing — First char of each word upper; rest lower.
Separator — Output words joined with single spaces.
It converts a string to start case: the first letter of each word is uppercase, remaining letters in each word are lowercase, words are separated by spaces.
_.capitalize() only uppercases the first character of the entire string. _.startCase() treats each word separately.
Yes. Underscores and hyphens are treated as word boundaries, so first_name becomes First Name.
Not reliably. USA may become Usa because each word is title-cased. Post-process acronyms if needed.
Similar visually, but _.startCase() returns a new string you can store or bind—not a CSS style.
UI labels, table headers, human-readable titles from machine keys, and formatting user-facing text from slugs.
Did you know?
_.startCase() capitalizes the first letter of each word and lowercases the rest—perfect for turning customer_first_name into display text.