function solution(s) {
var answer = '';
s.split(" ").map( v => {
for (let i = 0; i<v.length; i++){
!(i % 2) ? answer += v[i].toUpperCase() : answer += v[i].toLowerCase()
}
answer += ' '
})
return answer.slice(0,-1);
}
let solution= s=> s.split(' ').map(el => el.split('').map((e,i) => i%2?e.toLowerCase():e.toUpperCase()).join('')).join(' ');
function solution(s) {
return s.split(" ").map(v => {
let newStr="", num=0;
for(let str of v){
newStr += !(num%2)? str.toUpperCase(): str.toLowerCase();
num++;
}
return newStr;
}).join(" ");
}