Skip to content

Instantly share code, notes, and snippets.

@Risto-Stevcev
Created April 10, 2016 14:04
Show Gist options
  • Save Risto-Stevcev/84640635206ad39148ccea95ffb103ff to your computer and use it in GitHub Desktop.
Save Risto-Stevcev/84640635206ad39148ccea95ffb103ff to your computer and use it in GitHub Desktop.
String literal to template literal
const tmpl = string => new Function('return `'+ string +'`')()
const name = 'foo'
tmpl('hello ${name}!')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment