Created
April 10, 2016 14:04
-
-
Save Risto-Stevcev/84640635206ad39148ccea95ffb103ff to your computer and use it in GitHub Desktop.
String literal to template literal
This file contains 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 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