I have an array, and I want to convert the first letter to a capital by using map
const arrayTOCapital = [
'hi world',
'i want help ',
'change first letter to capital',
];
const arrayFirstLetterToCapital = () => {
return arrayTOCapital.map(function(x){ return
x.charAt(0).toUpperCase()+x.slice(1) })
}
The output should be:
Hi World
I Want Help
Change First Letter To Capital