I need to make a function that reads a string input and converts the odd indexed characters in the string to upperCase and the even ones to lowerCase.
function
RegExp alternative that handles space between characters :
const alternativeCase = s => s.replace(/(\S\s*)(\S?)/g, (m, a, b) => a.toUpperCase() + b.toLowerCase()); console.log( alternativeCase('alternative Case') )