Update ex1

This commit is contained in:
LSvekis 2021-06-29 19:11:04 -04:00 committed by GitHub
parent f30e0f1b49
commit fd4e24162d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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 => {