how to get the first letter in a string to upper case code example
Example 1: return first letter of string javascript in uppercase
function capitalizeFirstLetter(string) {
return string.charAt(0).toUpperCase() + string.slice(1);
}
console.log(capitalizeFirstLetter('foo')); // Foo
Example 2: make first letter uppercase
const publication = "freeCodeCamp";
publication[0].toUpperCase() + publication.substring(1);