Given a string change the every second letter to an uppercase
var str = 'hello world how ya doing?';
function toUpperCase(str) {
return str.split('').map((v, i) => i % 2 == 0 ? v.toLowerCase() : v.toUpperCase()).join('');
}
console.log(toUpperCase(str));