Update ex1

This commit is contained in:
LSvekis
2021-06-29 19:11:04 -04:00
committed by GitHub
parent f30e0f1b49
commit fd4e24162d
+2 -1
View File
@@ -1,5 +1,6 @@
const val = "world hello this will be capitalized for each word";
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 => {