diff --git a/Chapter 8/exercise 1 b/Chapter 8/exercise 1 deleted file mode 100644 index eeeda1d..0000000 --- a/Chapter 8/exercise 1 +++ /dev/null @@ -1,12 +0,0 @@ -const val = " thIs will be capiTalized for each word"; - function wordsCaps(str) { - str = str.toLowerCase(); - const tempArr = []; - let words = str.split(" "); - words.forEach(word => { - let temp = word.slice(0, 1).toUpperCase() + word.slice(1); - tempArr.push(temp); - }); - return tempArr.join(" "); - } - console.log(wordsCaps(val));