Answers for "javascript execute string code"

3

javascript execute string code

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

var F=new Function (theInstructions);

return(F());
Posted by: Guest on February-29-2020
0

js execute string

var myString = "console.log('I am Batman')";
eval(myString);
//carefull ! This will execute the code, therefore 
//be careful of where/how you got this string.
Posted by: Guest on May-26-2020

Code answers related to "javascript execute string code"

Code answers related to "Javascript"

Browse Popular Code Answers by Language