Capitalizes the first character of a string without lowercasing subsequent characters, preserving camelCase and PascalCase identifiers.
The string to capitalize
The capitalized string
capitalize('fancyGadget'); // 'FancyGadget' Copy
capitalize('fancyGadget'); // 'FancyGadget'
Capitalizes the first character of a string without lowercasing subsequent characters, preserving camelCase and PascalCase identifiers.