From a9686fba198e4d44fa2fa9f30accbcdeb15548fa Mon Sep 17 00:00:00 2001 From: Karan <50290386+Sonawane-Karan26@users.noreply.github.com> Date: Thu, 25 Nov 2021 19:59:04 +0530 Subject: [PATCH] cleanup --- Chapter 11/ex1 | 12 ------------ 1 file changed, 12 deletions(-) delete mode 100644 Chapter 11/ex1 diff --git a/Chapter 11/ex1 b/Chapter 11/ex1 deleted file mode 100644 index f5b38a8..0000000 --- a/Chapter 11/ex1 +++ /dev/null @@ -1,12 +0,0 @@ - const val = "world HEllo 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));