Capitalize
1 | const capitalize = (s) => { |
This created a function called capitalize, what you pass into it (hopefully a string) will be named ‘s’ and then passed into the {} function. That function checks the data type to confirm it’s a string, and then it processes the string by capitalizing the first letter, and concatinating the rest of the string.
Samples
1 | capitalize('flavio') //'Flavio' |
References