👍🏻 2022년 2월 3일
<script>
function solution(s) {
var answer = '';
let arr = s.split(" ");
let firstLetter;
arr.forEach((v, i) => {
if (i !== 0) answer += " ";
if (isNaN(v[0])) firstLetter = v.substr(0,1).toUpperCase();
else firstLetter = v.substr(0,1);
let restLetters = v.substr(1).toLowerCase();
answer += (firstLetter + restLetters)
})
return answer;
}
</script>