diff --git a/capitalizeEachWord b/capitalizeEachWord new file mode 100644 index 0000000..7aa1b77 --- /dev/null +++ b/capitalizeEachWord @@ -0,0 +1,15 @@ +String.prototype.capitalizeEachWord = function() { + let words = this.split(" "); + for (var x = 0; x < words.length; x++) { + let word = words[x]; + + if (word.length <= 3) { + continue; + } else { + sentence = sentence.replace(word[0], word[0].toUpperCase()); + } + + } + return sentence; + +}