Code Wars: Jaden Casing Strings

https://www.codewars.com/kata/5390bac347d09b7da40006f6/solutions/javascript


String.prototype.toJadenCase = function (str) {
  let arr = this.split(' ');
 
  for (i = 0; i < arr.length; i++) {
    arr[i] = arr[i].charAt(0).toUpperCase() + arr[i].substr(1);
  }
  return arr.join(' ');
};

Comments

Popular posts from this blog

Code Wars: Data Reverse (6 kyu)

Code Wars: longest_palindrome (6 kyu)

Code Wars: Find the odd int