https://programmers.co.kr/learn/courses/30/lessons/12930?language=javascript
function solution(s) {
let answer = "";
const wordArray = s.split(" ");
for (let i = 0; i < wordArray.length; i++) {
const word = wordArray[i];
let count = 1;
for (let j = 0; j < word.length; j++) {
const alphabet = word[j];
if (count % 2 !== 0 ) { // 홀수
answer += alphabet.toUpperCase();
} else {
answer += alphabet.toLowerCase();
}
count++;
}
if (i === wordArray.length - 1) {
break;
}
answer += " ";
}
return answer;
}