Created
June 28, 2017 20:15
-
-
Save aspencer8111/af4eede0a0fca1d61203343c93a4f4f4 to your computer and use it in GitHub Desktop.
jadenCase.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
String.prototype.toJadenCase = function () { | |
var words = this.split(' '); | |
var newSentanceArray = []; | |
for(var i=0; i<words.length; i++){ | |
var word = words[i]; | |
var capitalizedWord = word.charAt(0).toUpperCase() + word.slice(1); | |
newSentanceArray.push(capitalizedWord) | |
} | |
return newSentanceArray.join(' '); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment