showing results for - "given a string change the every second letter to an uppercase"
Gabin
26 Jan 2016
1var str = 'hello world how ya doing?';
2
3function toUpperCase(str) {
4  return str.split('').map((v, i) => i % 2 == 0 ? v.toLowerCase() : v.toUpperCase()).join('');
5}
6
7console.log(toUpperCase(str));