Keyword consistency in capitalize-first-letter-of-every-word
This commit is contained in:
@ -80,7 +80,7 @@ const average = arr =>
|
|||||||
Use `replace()` to match the first character of each word and `toUpperCase()` to capitalize it.
|
Use `replace()` to match the first character of each word and `toUpperCase()` to capitalize it.
|
||||||
|
|
||||||
```js
|
```js
|
||||||
var capitalizeEveryWord = str => str.replace(/\b[a-z]/g, char => char.toUpperCase());
|
const capitalizeEveryWord = str => str.replace(/\b[a-z]/g, char => char.toUpperCase());
|
||||||
```
|
```
|
||||||
|
|
||||||
### Capitalize first letter
|
### Capitalize first letter
|
||||||
|
|||||||
@ -3,5 +3,5 @@
|
|||||||
Use `replace()` to match the first character of each word and `toUpperCase()` to capitalize it.
|
Use `replace()` to match the first character of each word and `toUpperCase()` to capitalize it.
|
||||||
|
|
||||||
```js
|
```js
|
||||||
var capitalizeEveryWord = str => str.replace(/\b[a-z]/g, char => char.toUpperCase());
|
const capitalizeEveryWord = str => str.replace(/\b[a-z]/g, char => char.toUpperCase());
|
||||||
```
|
```
|
||||||
|
|||||||
Reference in New Issue
Block a user