Skip to content

Instantly share code, notes, and snippets.

@shioju
Last active April 9, 2018 15:11
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/b78984ee0749c7d8a9bb9b62f2188228 to your computer and use it in GitHub Desktop.
Save shioju/b78984ee0749c7d8a9bb9b62f2188228 to your computer and use it in GitHub Desktop.
Tagged Template Literals
const buttify = (strings, ...values) => {
return strings.map((str, i) => {
return typeof values[i] === "undefined" ? str : str + values[i]
}).join("").replace("cloud", "butt")
}
const adjective = "awesome"
buttify`Gcloud is ${adjective}`
//Gbutt is awesome
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment