JSFiddle - React, Tailwind, and code Playground
JavaScript
function runMe() {
alert("sucess");
}
// function we want to run
var fnstring = "runMe";
alert(fnstring);
// find object
var fn = window[fnstring];
alert(fn);
// is object a function?
alert(typeof fn === "function");
fn();