JSFiddle - React, Tailwind, and code Playground

by Exceeder

HTML

<div id="fbody"></div>

<div id="console" style="font-family:monospace"></div>

JavaScript

function display(msg) {
    $('#console').append($('<p>'+msg+'</p>'));
}

var functionString = function (message) {
    display(message);
}.toString();

$("#fbody").text(functionString);

eval("("+functionString+")('abc')");

var x = eval("("+functionString+")");
x('ddd');

try {
    eval(functionString);
} catch (e) {
    //happens, because after keyword 'function' a name is expected
    display(e); 
}