Created
August 7, 2020 14:34
-
-
Save mcsf/975e453f035fa382fd8504795ff2c651 to your computer and use it in GitHub Desktop.
It's a silly world out there.
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
| #!/usr/bin/env node | |
| const fs = require('fs'); | |
| const readline = require('readline'); | |
| const rl = readline.createInterface({ | |
| input: process.stdin, | |
| output: process.stdout, | |
| terminal: false, | |
| }); | |
| rl.on('line', line => { | |
| console.log(derpCase(line)); | |
| }); | |
| function derpCase(string) { | |
| return Array.from(string).map(c => | |
| Math.random() > 0.5 | |
| ? c.toUpperCase() | |
| : c.toLowerCase() | |
| ).join(''); | |
| } |
Author
mcsf
commented
Aug 7, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment