Created
April 30, 2015 20:35
-
-
Save rococodogs/461bd84e92408d6a15fc to your computer and use it in GitHub Desktop.
the coolest logging for today's rad-est teens
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
| // > console.teen("omg so kewl!") | |
| // OmG sO kEwL! | |
| console.teen = function() { | |
| var input = [].slice.call(arguments).join(' '), yay = true, i = 0, out = '', l | |
| if (!input.length) return; | |
| for(;i<input.length;i++) { | |
| l = input[i] | |
| if (/[a-z]/i.test(l)) { | |
| out += yay ? l.toUpperCase() : l | |
| yay = !yay | |
| } else { | |
| out += l | |
| } | |
| } | |
| console.log(out) | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment