App tip. Guard UI labels if empty should show a fallback.
Compatibility
Browser & Runtime Support
_.capitalize is a Lodash String helper (since 3.0.0). It needs no special browser APIs beyond loading Lodash.
✓ Stable · Lodash 3.0.0+
_.capitalize()
Available in [email protected] full builds and the lodash/capitalize modular import. Works in evergreen browsers and Node / Bun / Deno when Lodash is installed.
100%With Lodash 3.0.0+
Google ChromeSupported · Desktop & Mobile
Full support
Mozilla FirefoxSupported · Desktop & Mobile
Full support
Apple SafariSupported · macOS & iOS
Full support
Microsoft EdgeSupported · Chromium
Full support
Internet ExplorerNo native support · Use a polyfill
Polyfill
OperaSupported · Modern versions
Full support
Samsung InternetSupported · Android
Full support
BunSupported · JavaScript runtime
Supported
DenoSupported · JavaScript runtime
Supported
Node.jsSupported · Server runtime
Supported
Android WebViewSupported · Modern WebView
Full support
_.capitalizeLodash 3.0.0+
Bottom line: Safe for production once Lodash is on the page or in your bundle. Prefer import capitalize from "lodash/capitalize" for smaller builds.
Frequently Asked Questions
_.capitalize([string='']) converts the first character to upper case and the remaining characters to lower case. Official docs: _.capitalize('FRED') → 'Fred'.
No. capitalize lowercases everything first, then uppercases the first character. Use _.upperFirst() if you only want the first character changed.
capitalize → upperFirst(string.toLowerCase()). upperFirst only touches the first character and leaves the rest unchanged.
No. Only the first character of the whole string. For multi-word titles, use _.startCase().
No. Strings are immutable. _.capitalize always returns a new string.
Use import capitalize from "lodash/capitalize" or require("lodash/capitalize") for tree-shaking.