Last active
April 9, 2018 15:11
-
-
Save shioju/b78984ee0749c7d8a9bb9b62f2188228 to your computer and use it in GitHub Desktop.
Tagged Template Literals
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 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