Answers for ""a".capitalize()"

-1

capitalize

function capitalize1(str) {
  const arrOfWords = str.split(" ");
  const arrOfWordsCased = [];

  for (let i = 0; i < arrOfWords.length; i++) {
    const word = arrOfWords[i];
    arrOfWordsCased.push(word[0].toUpperCase() + word.slice(1).toLowerCase());
  }

  return arrOfWordsCased.join(" ");
}
Posted by: Guest on August-17-2020

Code answers related to ""a".capitalize()"

Python Answers by Framework

Browse Popular Code Answers by Language