Collection of convenience code snippets (helpers) that aims to make it a little easier to work with vanilla JS
vanillajs-helpers > “capitalize”
► capitalize(str: string): string
Defined in capitalize.ts:12
Capitalize each word in a phrase
capitalize('capitalize this phrase'); // -> Capitalize This Phrase
capitalize('capitalize-This-phrase'); // -> Capitalize-This-Phrase
Parameters:
| Param | Type | Description |
|---|---|---|
| str | string |
String to capitalize |
Returns: string