Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@shioju
Created April 9, 2018 15:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shioju/81453d49c125728ac40a1e3be85c7f99 to your computer and use it in GitHub Desktop.
Save shioju/81453d49c125728ac40a1e3be85c7f99 to your computer and use it in GitHub Desktop.
unbutt.js
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