JSFiddle - React, Tailwind, and code Playground

JavaScript

function test(){

}

function Result(){}
var functionName = 'test';
if (typeof window[functionName] == 'function'){
    alert('function exists, dont load it');
          }else{
    alert('function does not exist, load it');
}

Result();