Emperor01 / JSlearn

all my practical trainings
0 stars 0 forks source link

one of tasks #4

Open Emperor01 opened 6 years ago

Emperor01 commented 6 years ago

function ucFirst (word) { var firstLet = word.charAt(0), word_with_cap; word_with_cap = firstLet.toUpperCase() + word.slice(1); alert(word_with_cap); } // return word with capital first letter // P.S. name of function is not mine xD (from book)

ucFirst('word'); ucFirst('rapid'); ucFirst('dOG'); ucFirst(''); // they work