Keyword consistency in capitalize-first-letter-of-every-word
This commit is contained in:
@ -3,5 +3,5 @@
|
||||
Use `replace()` to match the first character of each word and `toUpperCase()` to capitalize it.
|
||||
|
||||
```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