Skip to content

Instantly share code, notes, and snippets.

@wesbos
Created Nov 8, 2019
Embed
What would you like to do?
/* eslint-disable */
String.prototype.sarcastic = function() {
return [...this]
.map((char, i) => char[`to${i % 2 ? 'Upper' : 'Lower'}Case`]())
.join('');
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment