I am trying to capitalize the first letter of the word, and replace it with smaller first letter of the word. I am done till, capitalizing the first letter but I do not know how to join the first letter with the rest of the letter in the word.
let a="i am using stack overflow and it is great";
function makeCapital(){
const words=a.split(" ");
console.log(words);
const firstLetter = words.map(letter=>letter.charAt(0));
console.log(firstLetter);
const capitalLetter=firstLetter.map(capital=>capital.toUpperCase());
console.log(capitalLetter);
}
//I do not know how to join this capiltal letter with rest of the letters in a word
makeCapital();