René Nyffenegger's collection of things on the web | |
René Nyffenegger on Oracle - Most wanted - Feedback
- Follow @renenyffenegger
|
new_Function [JavaScript snippet] | ||
function main() { var function_body = " \n\ var ret = arg_1 + arg_2; \n\ return ret; \n\ "; //txt_out('function_body:'); //txt_out(function_body) var func = new Function('arg_1', 'arg_2', function_body); //txt_out('func:'); //txt_out(func) var sum = func(10,20); txt_out('sum: ' + sum); }
See also other Javascript snippets
|