We're a place where coders share, stay up-to-date and grow their careers.
JavaScript
function formatText(message) { return message.split(" ") .map(function(el) { return el.split('') .map(function(letter, idx) { return idx % 2 === 0 ? letter.toLowerCase() : letter.toUpperCase(); }) .join(''); }) .join(' ') }
And as an extension, I used that function to create a Sponge Bob Mocking meme generator! (which is the first thing that I thought when I saw the challenge)
JavaScript
And as an extension, I used that function to create a Sponge Bob Mocking meme generator! (which is the first thing that I thought when I saw the challenge)