stringTocapital.js

//make a text have the first/all or the letter that indicates strings in uppercase...
//0/false = all lowercase and 1/true all uppercase
//you can use it for names or other text string
let str = "neshhero";

const stringToCapital = (name, index) => {
  let strTemplate = "";
  for (x = 0; x < str.length; x++) {
    x == 0
      ? (strTemplate += str[x].toUpperCase())
      : x == index - 1
      ? (strTemplate += str[x].toUpperCase())
      : index == true
      ? (strTemplate = str.toUpperCase())
      : index == false
      ? (strTemplate = str = str.toLowerCase())
      : (strTemplate += name[x]);
  }
Neshhero