Answers for "string to function javascript"

1

string to code javascript

var theInstructions = "alert('Hello World'); var x = 100";

var F=new Function (theInstructions);

return(F());
Posted by: Guest on May-19-2021
1

javascript function from string

var addition = Function("a", "b", "return a + b;");
alert(addition(5, 3)); // shows '8'
Posted by: Guest on December-15-2020

Code answers related to "string to function javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language