Public
Back

Version 19

5/16/2024
var __EVAL = s => eval(`void (__EVAL = ${__EVAL.toString()}); ${s}`);

function evaluate(expr) {
try {
const result = __EVAL(expr);
console.log(expr, "===>", result);
} catch (err) {
console.log(expr, "ERROR:", err.message);
}
}
evaluate("var ten = 10");
evaluate("function cube(x) { return x ** 3 }");
evaluate("ten + cube(3)");
evaluate("console.log(\"SIDE EFFECT\")");
evaluate("let twenty = 20");
evaluate("twenty + 40");
maxm-repp.web.val.run
Updated: May 18, 2024