Created
April 9, 2018 15:06
-
-
Save shioju/81453d49c125728ac40a1e3be85c7f99 to your computer and use it in GitHub Desktop.
unbutt.js
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
const unbutt = (buzzwords) => { | |
const words = buzzwords.join('').split(',') | |
return (sentence) => { | |
for (word of words) { | |
sentence = sentence.replace(new RegExp(word, 'g'), 'butt') | |
} | |
return sentence; | |
} | |
} | |
const buttbutt = unbutt`cloud,blockchain,microservice` | |
buttbutt("Buzzwords of 2018: cloud, blockchain and microservices.") | |
//Buzzwords of 2018: butt, butt and butts. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment