Added samples
This commit is contained in:
@ -4,4 +4,5 @@ Use `replace()` to match the first character of each word and `toUpperCase()` to
|
||||
|
||||
```js
|
||||
const capitalizeEveryWord = str => str.replace(/\b[a-z]/g, char => char.toUpperCase());
|
||||
// capitalizeEveryWord('hello world!') -> 'Hello World!'
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user