JSFiddle - React, Tailwind, and code Playground

by Brenton Strine

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();