JSFiddle - React, Tailwind, and code Playground

JavaScript

function runMe(thething) {
    console.log("the function has successfully run: " + thething);
}

// function we want to run
var fnstring = "runMe";
 
// find object
var fn = window[fnstring]("lkjlksdfsdfj");

// is object a function?
if (typeof fn === "function") fn();