Answers for "convert string to javascript code"

9

javascript convert a number in string

const num = 123; //> type number 123
const str = num.toString(); //> type string "123"
Posted by: Guest on March-30-2020
0

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
0

string to code javascript

function ExecuteJavascriptString()
{
    var s = "alert('hello')";
    // how do I get a browser to alert('hello')?
}
Posted by: Guest on May-19-2021

Code answers related to "convert string to javascript code"

Code answers related to "Javascript"

Browse Popular Code Answers by Language