I have a bit of JavaScript code that is specified in a configuration file on the server-side. Since I can\'t specify a JavaScript function in the configuration language (Lu
To do what you want, wrap your string in parentheses:
a = "function(value) { return Math.abs(value);}"; b = eval("("+a+")"); b(-1);