Apply new format to snippets and template
This commit is contained in:
@ -5,8 +5,8 @@ tags: string,intermediate
|
||||
|
||||
Converts a string from camelcase.
|
||||
|
||||
Use `String.prototype.replace()` to remove underscores, hyphens, and spaces and convert words to camelcase.
|
||||
Omit the second argument to use a default `separator` of `_`.
|
||||
- Use `String.prototype.replace()` to remove underscores, hyphens, and spaces and convert words to camelcase.
|
||||
- Omit the second argument to use a default `separator` of `_`.
|
||||
|
||||
```js
|
||||
const fromCamelCase = (str, separator = '_') =>
|
||||
@ -20,4 +20,4 @@ const fromCamelCase = (str, separator = '_') =>
|
||||
fromCamelCase('someDatabaseFieldName', ' '); // 'some database field name'
|
||||
fromCamelCase('someLabelThatNeedsToBeCamelized', '-'); // 'some-label-that-needs-to-be-camelized'
|
||||
fromCamelCase('someJavascriptProperty', '_'); // 'some_javascript_property'
|
||||
```
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user