Answers for "javascript convert letter to uppercase"

49

uppercase javascript

var str = "Hello World!";
var res = str.toUpperCase();  //HELLO WORLD!
Posted by: Guest on July-30-2020
2

captitalize js

function capitalize2(str) {
  str = str.toLowerCase();

  const arrOfWords = str.split(" ");

  const arrOfWordsCased = [];

  for (let i = 0; i < arrOfWords.length; i++) {
    const char = arrOfWords[i].split("");
    char[0] = char[0].toUpperCase();

    res.push(char.join(""));
  }
  return arrOfWordsCased.join(" ");
}
Posted by: Guest on June-19-2020

Code answers related to "javascript convert letter to uppercase"

Code answers related to "Javascript"

Browse Popular Code Answers by Language