Skip to content

Instantly share code, notes, and snippets.

@FirstWhack
Last active August 29, 2015 14:18
Show Gist options
  • Save FirstWhack/fb8ec0adac78b0c1b005 to your computer and use it in GitHub Desktop.
Save FirstWhack/fb8ec0adac78b0c1b005 to your computer and use it in GitHub Desktop.
function template(str, data) {
return str.replace(/\{(.*?)\}/g, function (derp, tag) { return data[tag]; });
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment