JSFiddle - React, Tailwind, and code Playground

JavaScript

var x = "foo";
window[x] = 'hi';
alert(foo);