Jaden Casing Strings

JavaScript

String.prototype.toJadenCase = function () {
  var words = this.split(' ');
  words.forEach(function(word, index) {
    words[index] = word.charAt(0).toUpperCase() + word.slice(1);
  });

  return words.join(' ');
};

Tags

  1. javascript (Private)
  2. 7-kyu (Private)
  3. codewars (Private)
  4. answer (Private)