Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Eval template strings
const regex = /(`[${}\w\.]+`)/gm
const evalInContext = function(input) {
const that = this
return input.replace(regex, function(match) {
return function() {
return eval(match)
//, template)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment