Last active
August 6, 2016 01:44
-
-
Save DrummerHead/36e34d47f81c4afe6f57aa6f66892069 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use this script on your | |
// preferred modern browser console | |
const meme = (text) => { | |
return [...text.toUpperCase()].reduce((prev, curr, i, ary) => { | |
return [`${prev[0]}${ary[i]} `, `${prev[1]}\n${ary[i + 1] || ''} `]; | |
}, ['','']).reduce((prev, curr) => prev + curr); | |
}; | |
const result = meme('Aesthetics'); | |
copy(result); // Text is copied to clipboard | |
console.log(result); | |
// A E S T H E T I C S | |
// E | |
// S | |
// T | |
// H | |
// E | |
// T | |
// I | |
// C | |
// S | |
// The two final spaces are so | |
// Markdown inserts a final <br> | |
// (Reddit uses Markdown) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Here's a much shorter version