//Updated //capitalize only the first letter of the string. functioncapitalizeFirstLetter(string){return string.charAt(0).toUpperCase()+ string.slice(1);}//capitalize all words of a string. functioncapitalizeWords(string){return string.replace(/(?:^|s)S/g,function(a){return a.toUpperCase();});};
constcapitalize=s=> s && s[0].toUpperCase()+ s.slice(1)// to always return type string event when s may be falsy other than empty-stringconstcapitalize=s=>(s && s[0].toUpperCase()+ s.slice(1))||""
myString ='the quick green alligator...';
myString.replace(/^w/,(c)=> c.toUpperCase());
myString =' the quick green alligator...';
myString.trim().replace(/^w/,(c)=> c.toUpperCase());
functionchangeToUpperCase(founder){return founder.toUpperCase();}// calling the function const result =changeToUpperCase("Quincy Larson");// printing the result to the consoleconsole.log(result);// Output: QUINCY LARSON