728x90
반응형
문제)
www.codewars.com/kata/5390bac347d09b7da40006f6/train/javascript
내가 푼 답)
String.prototype.toJadenCase = function () {
var strs = this.split(' ');
var result_strs = [];
strs.forEach((str) => {
result_strs.push(`${str[0].toUpperCase()}${str.slice(1)}`);
});
return result_strs.join(' ');
};
테스트 결과)
728x90
반응형
'Algorithm > codewars' 카테고리의 다른 글
You're a square! 답안 (0) | 2021.03.23 |
---|---|
Descending Order 답안 (0) | 2021.03.23 |
Convert string to camel case 답안 (0) | 2021.03.23 |
Categorize New Member 답안 (0) | 2021.03.23 |
Decode the Morse code 답안 (0) | 2021.03.23 |