Update ex1
This commit is contained in:
+2
-1
@@ -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) {
|
function wordsCaps(str) {
|
||||||
|
str = str.toLowerCase();
|
||||||
const tempArr = [];
|
const tempArr = [];
|
||||||
let words = str.split(" ");
|
let words = str.split(" ");
|
||||||
words.forEach(word => {
|
words.forEach(word => {
|
||||||
|
|||||||
Reference in New Issue
Block a user