Skip to content

Instantly share code, notes, and snippets.

@aspencer8111
Created June 28, 2017 20:15
Show Gist options
  • Save aspencer8111/af4eede0a0fca1d61203343c93a4f4f4 to your computer and use it in GitHub Desktop.
Save aspencer8111/af4eede0a0fca1d61203343c93a4f4f4 to your computer and use it in GitHub Desktop.
jadenCase.js
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