JSFiddle - React, Tailwind, and code Playground
by marcosc
JavaScript
"use strict";
var name = "foo";
var customAction = function() {
alert("hi there!")
}
//implement it
var func = new Function("action", "return function " + name + "(){ action() };")(customAction);
//test it
func();