Getting started with Script.apex
Evaluate JavaScript Expressions
Evaluating JavaScript expressions is as simple as one line of code:
Object result = ScriptEngine.getInstance().eval('1 + 2 * (3 - 1)');
Evaluating JavaScript expressions is as simple as one line of code:
Object result = ScriptEngine.getInstance().eval('1 + 2 * (3 - 1)');