I have the situation that I retrieve a function in a string:
var function_name = "function Test(value){return value + 1}";
now I want to execute the function and store the value inside a variable so for example:
var value = 10;
var calc_value = function Test(value){return value + 1}
console.log(calc_value); // should show 11
But I do not know how I could get the function out of the string and execute it and store the result in a variable.
Any ideas how I could do that? I know that having the function inside a string is not ideal at all but I can not change that.